After I insert some values in a JTable and close the app all the values dissapear. How do I do to save the values even if the app closes?
Asked
Active
Viewed 40 times
1 Answers
-1
Write the data to a file. Then when the program restarts you read the data from the file back into the table. So you can add a WindowListener to the frame to invoke the logic to save the data when the frame closes.
Check out Closing an Application for examples of how to invoke code when the frame is closed.
Check out: Saving content of Interactive JTable to .txt file to read it upon next run for a generic solution for saving and restoring the data.
Put the two concepts together of a possible solution.

camickr
- 321,443
- 19
- 166
- 288