Results 1 to 3 of 3
  1. #1
    Doctor Cactus is offline Member
    Join Date
    Oct 2008
    Rep Power

    Default 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.

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Blog Entries
    Rep Power


    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)

  3. #3
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Colombo, Sri Lanka
    Blog Entries
    Rep Power

Similar Threads

  1. writing and reading unicode characters from a file
    By ranoosh in forum Advanced Java
    Replies: 4
    Last Post: 09-28-2008, 05:34 AM
  2. writing/reading a Structure to/from a file
    By Farzaneh in forum New To Java
    Replies: 1
    Last Post: 08-31-2008, 03:21 PM
  3. Reading/Writing a File using byte array
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 01-16-2008, 11:41 AM
  4. Help with File reading and writing
    By baltimore in forum New To Java
    Replies: 1
    Last Post: 07-31-2007, 07:47 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts