Beginner needs help in JOGL Applet

Hello all :slight_smile:

I’m currently learning how to do an applet that uses jogl.

what I did is:

  • using eclipse, created the java applet. I’ve tried running the applet from eclipse, and it worked.

  • next, I created a HTML file for the applet. The applet tag looks like this:

<applet code="com.sun.opengl.utils.JOGLAppletLauncher"
     width=640
     height=480
     codebase="."
     archive="jogl.jar,gluegen-rt.jar">
  <param name="subapplet.classname" VALUE="jogl.applet.demo.JOGLApplet">
  <param name="subapplet.displayname" VALUE="JOGL Applet">
  <param name="progressbar" value="true">
  <param name="cache_archive" VALUE="jogl.jar,gluegen-rt.jar,JOGLApplet.class">
  <param name="cache_archive_ex" VALUE="jogl.jar;preload,gluegen-rt.jar;preload">
</applet>
  • Then, I put the HTML file, java class file, jogl.jar, jogl-natives-windows-i586.jar, and gluegen-rt.jar in a folder.
    when I opened the html, it says: Applet com.sun.opengl.utils.JOGLAppletLauncher notinited

What did I do wrong? Thank you so much for your help in advance

Where’s the jar file containing your applet? It should be part of the archive parameter. You also need the gluegen-rt-natives-windows-i586.jar in the same directory on the server as well, which you can download from the GlueGen home page, Documents & Files section.

You should open the Java Control Panel, Advanced tab, Java Console, and enable the Java Console so you can see any error messages produced by the applet when it launches.

Thanks for the reply Ken :slight_smile:

What I’ve done:

  • put my applet jar file, jogl.jar, gluegen.jar, jogl-natives-windows-i586.jar, and gluegen-rt-natives-windows-i586.jar in a folder
  • the applet tag becomes:
<applet code="com.sun.opengl.util.JOGLAppletLauncher"
     width=640
     height=480
     codebase="."
     archive="jogl.jar,gluegen-rt.jar,jogldemo.jar">
  <param name="subapplet.classname" VALUE="JOGLApplet">
  <param name="subapplet.displayname" VALUE="JOGL Applet">
  <param name="progressbar" value="true">
  <param name="cache_archive" VALUE="jogl.jar,gluegen-rt.jar,jogldemo.jar">
  <param name="cache_archive_ex" VALUE="jogl.jar;preload,gluegen-rt.jar;preload,jogldemo.jar;preload">
</applet>

it seems like the error is due to the signature on the files…
on IE, it says Native library gluegen-rt.dll isn’t properly signed or has other errors
using Firefox, it says java.lang.UnsupportedClassVersionError: com/sun/opengl/util/JOGLAppletLauncher (Unsupported major.minor version 48.0)

—EDIT—
I’ve replaced the gluegen-rt.jar file that I used with a newly downloaded one, and it works now on IE guess it was corrupted or something…but using firefox, it still gives the same error…not sure whether it’s the firefox side… o.o

If the JOGL applet test linked from the jogl-demos home page works (in both browsers), then the problem is with the binaries on your server. You might want to try clearing Firefox’s disk cache as well as the cache in the Java Control Panel.

yeah, I think my firefox is the problem. I asked a friend to try out both jogl-demos and also my own demo with IE and FF, and they worked with both.
Thanks :slight_smile: