Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Using serialization and Observable to save settings in a GUI.

 
Timmy Ryan
Ranch Hand
Posts: 63
IntelliJ IDE Java Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic