File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
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.
I agree. Here's the link:
subject: can the state of a checkbox be saved
It's not a secret anymore!