Hi folks.
 Im sure this is going to be embarrasing but I need an answer.
I cant get any of the "texture" examples to run in the Suns getting started with the 
java tutorial"
I have created a class using the code found in one of these examples for my own 
project however I get the same error everytime. The jpg is included in the same 
directory as the java files (as with Suns examples).
Im using forte if that helps..

error is: Error: in loading image
java.lang.NullPointerException
at javax.media.j3d.ImageComponent2D.<init>(ImageComponent2D.java:166)
at com.sun/j3d.utils.image.TextureLoader.getImage(TextureLoader.java:354)
at NewAppearance.<init>(NewAppearance.java:28)
at InteriorOfRoom.<init>(InteriorOfRoom.java:32)
at .....

Please put me out of my misery or alternately solve this little prob for me.

Thanks in advance.
Adrian

public class NewAppearance extends Appearance {

    /** Creates new NewAppearance */
    public NewAppearance()
    {
      super();
      String filename = "earth.jpg";
      TextureLoader loader = new TextureLoader(filename, new Panel());
/*line 28*/      ImageComponent2D image = loader.getImage();

      if(image == null) {
            System.out.println("load failed for texture: "+filename);
      }

      // can't use parameterless constuctor
      Texture2D texture = new Texture2D(Texture.BASE_LEVEL, Texture.RGBA,
                                        image.getWidth(), image.getHeight());
      texture.setImage(0, image);
      this.setTexture(texture);
    }

}

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to