I have made an application and i need to save some options before exit.(something like window dimension, ..., that will be written in a file.)
The main frame has set
May be the following will help.
First u need to read your property file. See doc
Properties properties = new Properties();
try {
properties.load(new FileInputStream("filename.properties"));
} catch (IOException e) {
System.err.println("Ooops!");
}
Second add event handler to your window, which will save your data in property file.All that you need to save just put in properties instance and store it on exit
addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
try {
properties.store(new FileOutputStream("filename.properties"), null);
} catch (IOException e) {
}
}
});
That's all, if I'd understood you correct)