wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes Dont want a CheckBox and a radio button selected state to be reset when Restart the application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Dont want a CheckBox and a radio button selected state to be reset when Restart the application" Watch "Dont want a CheckBox and a radio button selected state to be reset when Restart the application" New topic
Author

Dont want a CheckBox and a radio button selected state to be reset when Restart the application

Sammy Bill
Ranch Hand

Joined: Dec 29, 2008
Posts: 96
Hello,

in my swing application I have a Reference panel in my menu bar that allow the user to check some checkBoxes and some radio box based on his need.
However, those check boxes and radio boxes are reset to their default when I restart the application.

What should I do to have the state of the check boxes remain the same when the application exits and restart?

Thanks
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19649
    
  18

You'll have to store them when the application closes and reload them when it starts again. You can use a Properties object backed by a file for that, or perhaps java.util.prefs.Preferences.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Dont want a CheckBox and a radio button selected state to be reset when Restart the application
 
Similar Threads
"Java Applet Window" message
JSF with Javascript
Make Checkbox group Non-Editable
doubt
poulate a form from the reset (good practice)?