Author Topic: couple of random questions  (Read 3823 times)

Offline slenkar

  • byte
  • *
  • Posts: 20
    • View Profile
couple of random questions
« on: May 30, 2009, 08:07:54 pm »
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.


Offline paulscode

  • double
  • *****
  • Posts: 863
    • View Profile
    • PaulsCode.Com
Re: couple of random questions
« Reply #1 on: May 30, 2009, 08:33:20 pm »
1. 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.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: couple of random questions
« Reply #2 on: May 30, 2009, 08:57:37 pm »
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.

Offline slenkar

  • byte
  • *
  • Posts: 20
    • View Profile
Re: couple of random questions
« Reply #3 on: May 30, 2009, 09:30:15 pm »
thanks egon+paul that will send me in the right direction

Offline JavaMan

  • long
  • ***
  • Posts: 231
    • View Profile
Re: couple of random questions
« Reply #4 on: May 31, 2009, 04:00:38 am »
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

Offline zammbi

  • float
  • ****
  • Posts: 361
    • View Profile
Re: couple of random questions
« Reply #5 on: May 31, 2009, 11:47:56 am »
Quote
2.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.