Forums Register Login

Ok, how do common apps do this?

+Pie Number of slices to send: Send
I'm about to do an app that actually saves it state. For example, my app has a
checkbutton in it, an supposing i enabled it and then closed the swing app, how will i make the app so that the next time it starts the checkbutton is still enabled or disabled depending on the last time i used it?

Is this where serialization takes place?
+Pie Number of slices to send: Send
No, I wouldn't use serialization for this, I'd just use a Properties file. See the java.util.Properties class. Make up a property name like "doodad.checkbox.state" and set its value to "true" or "false" in the application's Properties object when you dismiss the dialog box. It's best to have a class whose job it is to wrap the Properties, and save it to disk whenever a value changes.
+Pie Number of slices to send: Send
+Pie Number of slices to send: Send
Thanks guys!!
Wink, wink, nudge, nudge, say no more, it's a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 824 times.
Similar Threads
the enter key forces a submit
Assertions
Enabling batch updates in hibernate
Hour 17:Creating Interactive Web Programs - Java in 24 hours
Identifying which users certificate was used to authenticate
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 11:16:20.