couple of random questions

Started by slenkar, May 30, 2009, 08:07:54 PM

Previous topic - Next topic

slenkar

1. If you create a webstart game or applet can the player save their game information on their PC?


2.When compiling a program in eclipse where is the compiled Jar file?, i looked in the workspace folder but it wasnt there.


paulscode

Quote from: slenkar on May 30, 2009, 08:07:54 PM1. If you create a webstart game or applet can the player save their game information on their PC?
One way to do this from an applet is to call an external javascript method (located on the same HTML page as your applet) which would set cookies on the user's browser to save game information.  I have done something very similar to this in a couple of projects I'm working on, so I might be able to help you out if you decide to go this route.

Another option (for an applet), is to sign your applet (or launch it with the lwjgl applet launcher).  When the user chooses to trust your digital signature, your applet *should* be able to access folders/files on the user's computer as you would in an application.  I have never actually done it myself, so I'm not completely certain if this works.

I haven't done anything with webstart, so I'm not sure what options you would have if you go that route.

EgonOlsen

With webstart, you can save your data on the PC. You have to sign your application for this, but you have to do that anyway when using LWJGL.

About Eclipse, there is no compiled jar...just the classes, usually in the bin-directory. If you want to make it a jar, you can do so in Eclipse somewhere, but it's pretty awkward IMHO. What i usually do, is much simpler: Install 7zip (or similar), zip the content of the bin directory, rename the file to .jar...done.

slenkar

thanks egon+paul that will send me in the right direction

JavaMan

If you don't want to, or can't sign your application for some reason. You could also use the PersistenceService in javax.jnlp. It sounds like want you may need.

http://java.sun.com/javase/6/docs/jre/api/javaws/jnlp/index.html

zammbi

Quote2.When compiling a program in eclipse where is the compiled Jar file?, i looked in the workspace folder but it wasnt there.
There's a export option to compile to 1 jar and choose the location.