Link to home
Start Free TrialLog in
Avatar of mschumacher74
mschumacher74

asked on

Java 3D Graphics: JVM hangs in Canvas3D constructor

Hi,

I am trying to create a simple graphics configuration and pass it to the Canvas#D constructor but the jvm hangs forever in the constructor and never reaches the next statement.

I have tried all the following ways without any luck.  I am a beginner in 3D java graphics, any help would be very much appreciated.

-----
Tried the following 3 ways without luck:

/* first try*/
GraphicsConfigTemplate3D template3d = new GraphicsConfigTemplate3D();
    GraphicsConfiguration[] arrConfig = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getConfigurations();
    GraphicsConfiguration config = template3d.getBestConfiguration(arrConfig);
Canvas3D canvas3D = new Canvas3D(config); //hangs here forever

/* second try */
GraphicsConfiguration config =                        SimpleUniverse.getPreferredConfiguration();
Canvas3D canvas3D = new Canvas3D(config); //hangs here forever

/* Third try */
GraphicsConfigTemplate3D template3d = new GraphicsConfigTemplate3D();
GraphicsConfiguration config = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getBestConfiguration(template3d);
Canvas3D canvas3D = new Canvas3D(config); //hangs here forever

/* Fourth try */
Canvas3D canvas3D = new Canvas3D(null);// this doesn't work since I am using a newer version that doesn't allow passing null for GraphicsConfiguration.  Hence I get an error message.

--------------


ASKER CERTIFIED SOLUTION
Avatar of TimYates
TimYates
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial