Applet Clubie...

ok this problem is, if want to use Slick2D then you must also use the slick.jar :slight_smile:

The following misses, slick.jar

<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">

You need to upload and include slick jar and add it to the above parameter.

<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, slick.jar">

There is a tutorial on the slick2d wiki i think.

AHHHHH…

so ‘param name=“al_jars”’ needs to contain a reference to every library that I use?

(The code I have is copied straight from that very tutorial btw ;D )

Ok, so now i’m getting:

Loaded image: jar:http://localhost/gameworks/apps/testApp/lwjgl_util_applet.jar!/appletlogo.png
Loaded image: jar:http://localhost/gameworks/apps/testApp/lwjgl_util_applet.jar!/appletprogress.gif
Wed Jul 21 16:21:28 BST 2010 ERROR:TestApplet.myApplet.Main
java.lang.ClassNotFoundException: TestApplet.myApplet.Main
	at java.net.URLClassLoader$1.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Unknown Source)
	at org.newdawn.slick.AppletGameContainer.init(AppletGameContainer.java:124)
	at org.lwjgl.util.applet.AppletLoader.switchApplet(AppletLoader.java:954)
	at org.lwjgl.util.applet.AppletLoader.run(AppletLoader.java:751)
	at java.lang.Thread.run(Unknown Source)
This occurred while 'Initializing real applet'
java.lang.RuntimeException: Unable to create game container
	at org.newdawn.slick.AppletGameContainer.init(AppletGameContainer.java:148)
	at org.lwjgl.util.applet.AppletLoader.switchApplet(AppletLoader.java:954)
	at org.lwjgl.util.applet.AppletLoader.run(AppletLoader.java:751)
	at java.lang.Thread.run(Unknown Source)

Does my have to reference my applications Main method, or the actual game method?

EDIT: also, does my Main method have to create an AppGameContainer or an AppletGameContainer?

Yup i’m afraid so, its not yet advanced enough to automatically guess and obtain the needed jars :slight_smile:

You only use AppletGameContainer in the html when using applets with Slick2D. Also remember when running slick java applets the main method is never called or used, so you can leave AppGameContainer in the main method and use the same code for both slick applets and applications.

right now the next error you are getting is because your missing the jar containing your games code, so what you need to do is put your code in a jar and add it to al_jars.

To carry on the nubie questions …


<!-- Main Applet Class -->
    <param name="al_main" value="org.newdawn.slick.AppletGameContainer">
    <param name="game" value="TestApplet.myApplet.Main">

My application is in TestApplet.jar. does this mean that i need the game classpath to be ‘TestApplet.myApplet.Main’ or just ‘myApplet.Main’?

EDIT:

Ahh, the second one seems to work (sorta…)

At least it seems to be finding everything now. I’m thinking that maybe I should have the actual ‘TestApplet extends BasicGame’ class in the ‘game’ parameter, rather than the applications main class, right?


Loaded image: jar:http://localhost/gameworks/apps/testApp/lwjgl_util_applet.jar!/appletlogo.png
Loaded image: jar:http://localhost/gameworks/apps/testApp/lwjgl_util_applet.jar!/appletprogress.gif
Wed Jul 21 16:46:18 BST 2010 ERROR:myApplet.Main cannot be cast to org.newdawn.slick.Game
java.lang.ClassCastException: myApplet.Main cannot be cast to org.newdawn.slick.Game
	at org.newdawn.slick.AppletGameContainer.init(AppletGameContainer.java:124)
	at org.lwjgl.util.applet.AppletLoader.switchApplet(AppletLoader.java:954)
	at org.lwjgl.util.applet.AppletLoader.run(AppletLoader.java:751)
	at java.lang.Thread.run(Unknown Source)
This occurred while 'Initializing real applet'
java.lang.RuntimeException: Unable to create game container
	at org.newdawn.slick.AppletGameContainer.init(AppletGameContainer.java:148)
	at org.lwjgl.util.applet.AppletLoader.switchApplet(AppletLoader.java:954)
	at org.lwjgl.util.applet.AppletLoader.run(AppletLoader.java:751)
	at java.lang.Thread.run(Unknown Source)


EDIT-EDIT:

;D

http://sphotos.ak.fbcdn.net/hphotos-ak-ash2/hs091.ash2/37871_413481956716_555931716_5198123_262480_n.jpg

Finaly!


Loaded image: jar:http://localhost/gameworks/apps/testApp/lwjgl_util_applet.jar!/appletlogo.png
Loaded image: jar:http://localhost/gameworks/apps/testApp/lwjgl_util_applet.jar!/appletprogress.gif
Wed Jul 21 16:48:43 BST 2010 INFO:Slick Build #274
Wed Jul 21 16:48:45 BST 2010 INFO:Starting display 640x480
Loading: net.java.games.input.DirectAndRawInputEnvironmentPlugin
Failed to initialize device Wacom Virtual Hid Driver because of: java.io.IOException: Failed to acquire device (8007001e)
Wed Jul 21 16:48:45 BST 2010 INFO:Found 4 controllers
Wed Jul 21 16:48:45 BST 2010 INFO:0 : Comfort Curve Keyboard 2000
Wed Jul 21 16:48:45 BST 2010 INFO:1 : Wacom Virtual Hid Driver
Wed Jul 21 16:48:45 BST 2010 INFO:2 : Wacom Virtual Hid Driver
Wed Jul 21 16:48:45 BST 2010 INFO:3 : Virtual Keyboard Driver

jar file name has nothing to do with specifying the class name to use. You only need to put the names of the packages (folders in the jar) before the name of the your Main class.

Yeh, I tried that and it works. (Edited my last post)

Thanks all :slight_smile: I’m slowly getting there. Now I just need to figure out why it works and I’ll be happy.