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 saving settings Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "saving settings" Watch "saving settings" New topic

saving settings

tomo black

Joined: Mar 01, 2004
Posts: 11
hi, i have designed a GUI which accepts user input. i would like to be able to save these values, so that the next time the user runs the application, they do not have to re-enter those values again but can retrieve them from a menubar option.
i am not really sure how to go about this task. I was going to use java.util.Properties to do this. is this the right way to go or is there a better way?
any help would be much appreciated.
thanks in advance
Nathan Pruett

Joined: Oct 18, 2000
Posts: 4121

Yes, java.utils.Properties is the way that this is usually done. Here is the section on Properties in the Java tutorial if you need any help on this. A new class, java.util.Preferences, was added in 1.4 that provides a more hierarchical preferences scheme, but Properties should be good for most things.

Write once, run anywhere, because there's nowhere to hide! - /. A.C.
I agree. Here's the link:
subject: saving settings
It's not a secret anymore!