wood burning stoves 2.0*
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

can the state of a checkbox be saved

Tris Rabar
Ranch Hand

Joined: Feb 27, 2002
Posts: 72
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?

- Trish -
Dirk Schreckmann

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.
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: can the state of a checkbox be saved
Similar Threads
Code for JTree with checkbox
Adding CheckBox and Text as child of a tree
html:checkbox tag
checkbox and popup
Checkbox node update