Hi.
A sample can running in Jbuilder3(appletviewer) but happen errors on IE.
That sample is EarthApp.java  on java3d tutorial.
I guess when load the Earth.jpg that error happen.I dont know why.The Earth.jpg is in same directory.
I using IE5 and Netscape 4.6.Does that can not load image with TextureLoader?
 
        follow is code fragment
 
        String filename = "earth.jpg";
        System.out.println("attempt to load texture from file: "+filename);
        TextureLoader loader = new TextureLoader(filename, this);
        ImageComponent2D image = loader.getImage();
 
The error message is on IE java console.
Error: in loading image
java.lang.NullPointerException
 at javax.media.j3d.ImageComponent2D.<init>(ImageComponent2D.java:59)
 at com.sun.j3d.utils.image.TextureLoader.getImage(TextureLoader.java:294)
 at EarthApp.createTwistAppearance(EarthApp.java:79)
 at EarthApp.createSceneGraph(EarthApp.java:113)
 at EarthApp.<init>(EarthApp.java:146)
 at java.lang.Class.newInstance0(Nativ Method)
 at java.lang.Class.newInstance(Unknown Source)
 at sun.applet.AppletPanel.createApplet(Unknown Source)
 at sun.plugin.AppletViewer.createApplet(Unknown Source)
 at sun.applet.AppletPanel.runLoader(Unknown Source)
 at sun.applet.AppletPanel.run(Unknown Source)
 at java.lang.Thread.run(Unknown Source)
 
My IE html document is follow code.
<html>
  <head>
    <title>Java2D Demo</title>
  </head>
 
  <body>
     <OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
     width="700" height="520" align="baseline"
     codebase="http://java.sun.com/products/plugin/1.2.2/jinstall-1_2_2-win.cab#Version=1,2,2,0">
     <PARAM NAME="code" VALUE="EarthApp.class">
     <PARAM NAME="type" VALUE="application/x-java-applet;version=1.2.2">
     <PARAM NAME="scriptable" VALUE="true">
      No JDK 1.2 support for APPLET!!
     </OBJECT>
  </body>
</html>
 
Someone know why or can help me.
 
 
Chen Lu
 

Reply via email to