Basically I've got a text editor which revolves around a jTextArea. There are some settings (e.g. whether line wrap is enabled) that I'd like to save to a file when the application closes, and then load up again when it runs next.
I've spent a few hours trying to get it to work by saving to a plain text file and failed, then tried using a serialisable class (which probably isn't even meant to work that way) - and have eventually given up on getting it working without help :)
There are two main questions I have:
1. How should I implement the whole process of saving the settings before I quit, and loading them up again when the program starts up next? Is a plain text file the best solution?
The main problem I had earlier with this was with retrieving the information. I was able to save the settings to the file properly, but kept getting NullReferenceErrors when trying to read values back in. I worked out that the file was being found successfully and opened, but the data was being read in as 'null' for some reason.
2. What is the best way to let the user modify these settings?
I've been trying to implement it using a modal JDialog. Is that the best way, or would you suggest something else?
Keep in mind that I'm doing this to teach myself the language. So please don't just give me answers :) I'd rather just be pointed in the right direction if possible.