I want my app to store the last used file so that the next time the user opens up the application the file is loaded automatically.
I'm using Preferences to store this. However, when I store the filename, it seems to save the swing widget instead, which means I get an error when the application loads next time.
Code to save the filename:
Code in the constructor trying to load the filename:
The error I get when the code runs:
Any ideas gratefully received.