Results 1 to 3 of 3
Thread: Reading/Writing to file
- 10-28-2008, 02:40 PM #1
Member
- Join Date
- Oct 2008
- Posts
- 63
- Rep Power
- 0
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)
- 10-28-2008, 03:05 PM #3
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,370
- Blog Entries
- 1
- Rep Power
- 26
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.
Similar Threads
-
writing and reading unicode characters from a file
By ranoosh in forum Advanced JavaReplies: 4Last Post: 09-28-2008, 05:34 AM -
writing/reading a Structure to/from a file
By Farzaneh in forum New To JavaReplies: 1Last Post: 08-31-2008, 03:21 PM -
Reading/Writing a File using byte array
By Java Tip in forum Java TipReplies: 0Last Post: 01-16-2008, 11:41 AM -
Help with File reading and writing
By baltimore in forum New To JavaReplies: 1Last Post: 07-31-2007, 07:47 PM
Bookmarks