Applet

Hi all,

I am trying to make a java applet (yes, i know you all advise webstart, but i need to make a applet now)

and i followed the tutorial, but when i try to run it, i get the following error:



23-sep-2008 16:48:43 com.jme.system.lwjgl.LWJGLDisplaySystem <init>

INFO: LWJGL Display System created.

Exception in thread "thread applet-app.AppletTestBoxColor-1" java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path

at java.lang.ClassLoader.loadLibrary(Unknown Source)

at java.lang.Runtime.loadLibrary0(Unknown Source)

at java.lang.System.loadLibrary(Unknown Source)

at org.lwjgl.Sys$1.run(Sys.java:72)

at java.security.AccessController.doPrivileged(Native Method)

at org.lwjgl.Sys.doLoadLibrary(Sys.java:65)

at org.lwjgl.Sys.loadLibrary(Sys.java:81)

at org.lwjgl.Sys.<clinit>(Sys.java:98)

at org.lwjgl.opengl.AWTGLCanvas.<clinit>(AWTGLCanvas.java:85)

at com.jmex.awt.lwjgl.LWJGLAWTCanvasConstructor.makeCanvas(LWJGLAWTCanvasConstructor.java:45)

at com.jmex.awt.lwjgl.LWJGLAWTCanvasConstructor.makeCanvas(LWJGLAWTCanvasConstructor.java:42)

at com.jme.system.lwjgl.LWJGLDisplaySystem.createCanvas(LWJGLDisplaySystem.java:212)

at com.jme.system.lwjgl.LWJGLDisplaySystem.createCanvas(LWJGLDisplaySystem.java:189)

at com.jmex.awt.applet.SimpleJMEApplet.init(SimpleJMEApplet.java:156)

at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)



i searched the forum, but i guess i must have missed the answer

Can anyone please tell me what i did wrong?



Thank you in advance.

Well, it can't find LWJGL. First: if you followed my tutorial for setting up jME 2 with Netbeans, it is my fault, it has that error and I am fixing it. If not, then you need to make sure that with the jars, you have the appropriate DLLs in the correct place that jME can link to.

I did it with eclipse, (but had to do a few things differend since there was no JME2 tutorial)

i used JME2, but it does run in eclipse, but as soon as i try it run in a applet (after the tutorial) things go wrong,

so this might have something to do with the installation of JME2?

are you using jme 2 (svn) or jme 1cvs?

ok jme 2 … :slight_smile:



Applets are run differently in jme1 and jme2, i didn’t have time to make a tutorial for it yet. :confused:



This is an example applet code which you can use:


<applet code="org.lwjgl.util.applet.AppletLoader"
archive="lwjgl_util_applet.jar, lzma.jar" 
codebase="../applet_jars"  width="640" height="480">
<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,../appl_jar/AppletTestTerrain.jar,../jme_jars/jorbis-0.0.17.jar,../jme_jars/jme.jar,../jme_jars/jme-awt.jar,../jme_jars/jme-audio.jar,../jme_jars/jme-collada.jar,../jme_jars/jme-editors.jar,../jme_jars/jme-effects.jar,../jme_jars/jme-font.jar,../jme_jars/jme-gamestates.jar,../jme_jars/jme-model.jar,../jme_jars/jme-scene.jar,../jme_jars/jme-terrain.jar,../jme_jars/jme-xml.jar,../jme_jars/jmetest.jar,../jme_jars/jmetest-data-cursor.jar,../jme_jars/jmetest-data-images.jar,../jme_jars/jmetest-data-model.jar,../jme_jars/jmetest-data-skybox1.jar,../jme_jars/jmetest-data-sound.jar,../jme_jars/jmetest-data-texture.jar">
<param name="al_title" value="Applet_AppletTestTerrain">
<param name="al_main" value="AppletTestTerrain">
<param name="al_windows" value="../jme_jars/windows_natives.jar.lzma">
<param name="al_linux" value="../jme_jars/linux_natives.jar.lzma">
<param name="al_mac" value="../jme_jars/macosx_natives.jar.lzma">
</applet>



You can take a look at my directory structure here http://www.core-dump.ch/gwt/
The important files are in this directory: http://www.core-dump.ch/gwt/applet_jars/
the jar for the application itself is defined with the "al_main" parameter.

Ok, well, there are BTW, in the The Tutorials - jME 2 section, for Netbeans. Need someone else to do it for Eclipse, I am not familiar with that IDE.

Thank you Core,

first of all thank you :slight_smile:

just out of lazyness… do you happen to have a zip or rar file of that directory and its files ? :stuck_out_tongue:

since its going to take a long time downloading everything.



Thank you in advance

nvm

almost got them all :slight_smile:

You should use your own jme-*.jars and sign them with your signature.

The lwjgl jar containing the AppletLoader and the native (lzma) are from here: http://sourceforge.net/project/showfiles.php?group_id=58488&package_id=54362&release_id=626517

Well i got my applet working, using a jnlp file…

but now it wont load my textures…

i think it might have something to do with my classpath or something becouse in eclipse it only loaded them on:



C:UsersrmeitudeDocumentsExternal source codejmonkeyengine-read-onlybuildjmetestdatatexture



and does not load them anymore when they are in a images dir (which is in the same dir as my src dir)

i load the images with this function:



public URL getUrl(String filename){

return HelloMeApp.class.getResource("…/"+filename);

}



where HelloMeApp is my class.



Am i doing something wrong here?



thank you :slight_smile:

i always use the ResourceLocator to load resources, this way it will find the resources no matter how you deploy the application.

There are some examples in the forum or jmetest package.

mmm that didnt work for me either, but i solved it by putting it on a webserver and used localhost to get the images, but nevertheless, thank you for helping me :slight_smile: