This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes Using serialization and Observable to save settings in a GUI. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Using serialization and Observable to save settings in a GUI." Watch "Using serialization and Observable to save settings in a GUI." New topic
Author

Using serialization and Observable to save settings in a GUI.

Timmy Ryan
Ranch Hand

Joined: Dec 09, 2007
Posts: 63

I have settings in a GUI that I save to a file using serialization.

I have a JPanel that needs to display these values as soon as they change.
So what I have done is made the utility class that writes the object out to file Observable.
Then when this is called is sends a message to the JPanel which extends Observer.

The JPanel then reads what is in the file and displays the results.

Is there another way I should be doing this? I have to save the settings to a file as I want them to persist.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Using serialization and Observable to save settings in a GUI.
 
Similar Threads
Remembering frames position after quit/restart
About design pattern used in SCJD
How to cleanly seperate Model/View/Controller ?
Java bean Persistence not working
Extend in Java