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...
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...
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
You can use the App Data folder and persist some metadata (JSON or XML) with the image ID, after open your application you check the metadata and update your background.
To get your app data folder you can do
System.getProperty("user.dir");