View Full Version : Restart java application

04-12-2008, 03:44 PM

I am busy making a gui and I run in to a problem, because I have an option in the settings menu. The application is fullscreen and therefore we have an option in the settings menu made with radiobuttons to choose if you want the application to run in fullscreen mode of windowed mode. Now the thing is people always start the application in fullscreen even if they had chosen the windowed mode before. so when people select the windowed mode I would like to restart the application (onl this time NOT fullscreen).

Only my problem is that I dont know how I can restart the gui without doing it manualy. is there some code for restarting?

04-13-2008, 03:00 PM
One option could be to dispose of all your current windows and then re-run the gui (this of course depends on how you are creating your gui in the first place).

Or if this setting was somehow settable in a file you could just set the non-windowed mode in a file, and then close out your java program, but right before you do you start up a new java program (your same java program but a clone).

In any case, it depends on how you are handling your gui.

04-14-2008, 01:58 AM
thank you for your information, we found a similar solution for our prob. were going to save a xml file witch tells the application to start fullscreen or windowed mode. the player gets a message that it will be affected as soon as he restarts the game with the option to do it now or later. he just has to start up the game himself. the application will read the xml file first then it knows what state it must start-up.

I will check if the xml reading also works with the clone version, because then maybe the player doesnt have to start it up himself, like in "real games". You think it would work with the clone?

anyway, I dont really know what you want to know if your ask me "how am I creating my gui in the first place" or "how I am handling my gui".