Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to save changes in program?

Tags:

java

image

I have a program that have images(default) for background , but user can change and select images for background . But if i close the program and open again the images go back to default . How to save the changed images in my program ?

Thanks...

like image 676
user3582100 Avatar asked May 02 '26 07:05

user3582100


1 Answers

You're going to need to save the preferences to some sort of external properties of preferences mechanism. The properties will not be persisted without it.

MKyong has a simple example of using properties files. You can also see the Official Java tutorial for Properties

You'll probably also want to have a look at the Java Preferences API. Also here's a more/most recent documentation

like image 195
Paul Samsotha Avatar answered May 04 '26 19:05

Paul Samsotha



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!