GeeCON Prague 2014*
The moose likes Swing / AWT / SWT and the fly likes can the state of a checkbox be saved Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "can the state of a checkbox be saved" Watch "can the state of a checkbox be saved" New topic
Author

can the state of a checkbox be saved

Tris Rabar
Ranch Hand

Joined: Feb 27, 2002
Posts: 72
Hi,
Is it possible to save the state of a checkbox?
I am trying to save a tree view that contains checkboxes at the nodes, and need to save which values/nodes are selected. Can I do this? If so,
how's it done?
Thanks...


- Trish -
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
Couple of ideas:
Have you looked into Serialization (also Object Serialization)?
And just to keep track of a few checkboxes, perhaps you could write a simple text file when you close the program, then read the text file when you start the program.
Good Luck.


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
Paul Stevens
Ranch Hand

Joined: May 17, 2001
Posts: 2823
Or maybe a properties file.
 
Consider Paul's rocket mass heater.
 
subject: can the state of a checkbox be saved