Run an applet from the desktop

I am entering my game in a competition that requires the use of an installer. I can write an executable, but my problem is that I’ve never needed to run an application from the desktop.

I tried to look this up, but the only JNLPs I’ve seen reference actual websites. I’m not sure how to make it reference a JAR file in, say, “C:\Documents and Settings[the user’s username]\My Documents\gameName”.

I’ve also tried using a different folder just to test it out, and it said it couldn’t find the class I told it reference even though I know for a fact it was in the JAR file I told it to reference.

Here’s my JNLP code if it helps at all.
<jnlp spec="1.0+" codebase="file:///G:/Game/" href="Game.jnlp"> <information> <title>Game</title> <vendor>Someone</vendor> <offline-allowed/> </information> <resources> <jar href="file:///G:/Game/Game.jar"/> </resources> <application-desc main-class="Game"/> </jnlp>

hi file://… URI aren’t remote URL and therefore require no connection… if you want to test the jnlp, you could just install some local small webserver and set http://localhost:80/yourjnlp.jnlp as code base.

::slight_smile: So… he should write an installer, that launches an http server, so that he doesn’t need an installer to launch his game.

One other consideration. I don’t know how you write your applets, but I try to put a much as possible of my GUI onto a JPanel, then add the JPanel to the applet. If you do that, then you should just as easily be able to add the JPanel to a JFrame (desktop version).

I’m no expert, and I’m not aware of any situations where this wouldn’t be a good idea, if anyone does, I am all ears.