Reading/Writing to file
Hi, I am writing a Java application and i want to have a txt file so that values in the txt file can change in the program. For example, if a dialog box appears in my application, it could have an option that says "Don't show this message again", and if the user ticks the box, the value would be written to the txt file so that it won't appear in future. I have heard about filereader and filewriter, but the examples I have seen are bad and how would you search for the specific value you are looking for? So, if someone knows how to do this, could you please post a code example.
Help is much appreciated.
My two cents (for what it's worth) is that instead of using a text file, use a tool that has been created specifically for this, specifically to store and retrieve the properties of your program. This tool is aptly named Properties, and you can find more about this here:
Properties (The Java™ Tutorials > Essential Classes > The Platform Environment)
Or else you can use an XML file as a configuration file. May be it can be too hard to you if you are not familiar with XML file reading and updating.