Hallo, i tried to learn something about java 3d by following sun’s java 3d tutorial step by step but everytime i try to compile i get a NullPointerException. The code from the Example is listed below, I’m working with the Eclipse IDE on a Windows system (which shouldn’t matter anyway, because it should work on any IDE / OS, but I listed those things just in case…)
Hi,
a null GraphicsConfiguration throws a NullPointerException in the current Java 3D 1.5.x release. Give this a try:
import java.awt.GraphicsConfiguration;
GraphicsConfiguration gc = SimpleUniverse.getPreferredConfiguration();
Canvas3D canvas3D = null;
try {
canvas3D = new Canvas3D(gc);
}
catch (NullPointerException e) {
// handle exception
}
catch (IllegalArgumentException e) {
// handle exception
}
Good luck, August
thanks for your help, it did work:) now it’s time to continue my studies on the java 3d tutorial:)