I have a program that uses three JTextField fields as the main data entry fields. I want to have it so that when the user terminates the program and then opens it again, their last entry will still be in the fields.
How could I achieve this? Would I need some sort of database or is there a simpler way?
the simplest way to achieve this is to add a listener to the text field and use the java preferences api:
but in this way every time you change value in the text field it is saved. If you want to save it only when application is closed, you can add a WindowListener to your application and write in its
method the content of the previous changedUpdate.