Running Applet In Browser

I have tried to solve my issue on my own but have been running into dead ends. Now my girlfriend is getting angry at the constant sound of my head hitting the keyboard in frustration.  My issue is that I am trying to get my applet I "wrote" (Copy and paste) using SimpleJMEApplet to run in a browser.  I ran into issues with JME 1.0 and have updated to JME 2.0.  My html is as follows:

  <applet code="org.lwjgl.util.applet.AppletLoader" archive="lwjgl_util_applet.jar, lzma.jar" codebase="." width="640" height="480">
    <param name="al_title" value="Dreamlore">
    <param name="al_main" value="com.test.mygame.testApplet">
    <param name="al_logo" value="appletlogo.png">
    <param name="al_progressbar" value="appletprogress.gif">
    <param name="al_jars" value="lwjgl_applet.jar.pack.lzma, lwjgl.jar.pack.lzma, jinput.jar.pack.lzma, lwjgl_util.jar.pack.lzma, res.jar.lzma, jme.jar,jme-swt.jar,jme-awt.jar,jme-model.jar, jme-terrain.jar,mygame.jar">
    <param name="al_windows" value="windows_natives.jar.lzma">
    <param name="al_linux" value="linux_natives.jar.lzma">
    <param name="al_mac" value="macosx_natives.jar.lzma">
    <param name="al_solaris" value="solaris_natives.jar.lzma">
    <param name="al_prepend_host" value="false">
    <param name=

Did you try it in firefox 2 and 3, IE 6 and 7 ?

Applets worked for me in one, but didn't work in the other browser.

In IE 7 it freezes at switching applet and throws this error.

java.lang.NullPointerException: null pData

In firefox 3 (windows xp) it freezes

Exception in thread "Thread-6" java.lang.NullPointerException
   at sun.plugin.util.AnimationPanel.createTranslucentImage(Unknown Source)
   at sun.plugin.util.AnimationPanel.createGradientShapeImage(Unknown Source)
   at sun.plugin.util.AnimationPanel.initBackground(Unknown Source)
   at sun.plugin.util.AnimationPanel.preloadResources(Unknown Source)
   at sun.plugin.util.AnimationPanel.doPaint(Unknown Source)
   at Source)
   at Source)
Nov 30, 2008 11:29:23 AM com.jme.system.lwjgl.LWJGLDisplaySystem <init>
INFO: LWJGL Display System created.

In Firefox 3 (Ubuntu) I only get  INFO: LWJGL Display System created. in the java console

thats a strange NullPointerException.

I usually just have to click once inside the applet area to actually activate the applet (after it has been finished loading and "INFO: LWJGL Display System created." is displayed.)

The clicking thing doesn't seem to do anything…

anyone…please  :frowning:


pretty same problem here but without an exception.

First: The Java Console prints me in Firefox 3.0 and IE 7.0/8.0:

18.04.2009 20:38:35 com.jme.system.lwjgl.LWJGLDisplaySystem <init>
INFO: LWJGL Display System created.

after a click:
18.04.2009 20:42:51 com.jme.renderer.lwjgl.LWJGLRenderer <init>
INFO: LWJGLRenderer created. W:  800H: 600 Version: 2.1.0
18.04.2009 20:42:52 com.jme.renderer.AbstractCamera <init>
INFO: Camera created.
18.04.2009 20:42:52 com.jme.scene.Node <init>
INFO: Node created.
18.04.2009 20:42:52 com.jme.input.joystick.DummyJoystickInput <init>
INFO: Joystick support is disabled
18.04.2009 20:42:52 com.jme.scene.Node <init>
INFO: Node created.

Opera 9.x*, chrome 1.0, Safari 3/4 beta:
The applet freezes after "INFO: LWJGL Display System created." and a click doesn't change anything.

*Opera seems to use it's own java-vm, so I can't log the console-prints, but the applet-behavior seems to be the same as in chrome and Safari.

All jme jar are signed.

Any ideas how and where to fix it? It is possible to avoid the click? The LWJGL AppletLoader-Demo runs without the click.



If you're okay with using the latest JVM for some time - use jnlp to deploy your applets, it's much more reliable than using jme's current applets with lwjgl's deployment mechanism - lwjgl_util_applet.jar (LWJGL updated their applet deployment style, but jme's applets are attempting to do it old-style, which is why you need to click the applet, and why on some machines it doesn't work).

With a JNLP, you can specify the natives using java's new built-in features (unless you want to support older JVMs, using things already in the new JVM seems like a good idea to me).

If you want to deploy with lwjgl's new applets, it should work with the applets discussed in this thread:

However, I haven't tested them in a browser yet, so your safest bet is using a jnlp.

Thx for your help,

yes it's properly the best way to deliver JME-Apps with Webstart. So i will think about it. It would be nice to deliver apps directly and built-in in the browser window. But this could be nearly unimportant.



MaxDaten said:

It would be nice to deliver apps directly and built-in in the browser window

Actually, that was sort of what I was talking about - starting from Java 6 update 10, you can deploy applets using JNLP.

The problem with deploying applets is that there used to be no built in way to specify natives, and you needed a custom loader to do that. With the JNLP deployment style for applets, you can specify them using built-in mechanisms, thus solving all problems with custom loaders.