Results 1 to 2 of 2
  1. #1
    jadaleus is offline Member
    Join Date
    Oct 2008
    Posts
    12
    Rep Power
    0

    Default Saving To A New Line Using A Text File

    can anyone tell me why my text is not saving to new line, it just appends at the end of the last text.

    Can anyone but NORM reply

    THANK YOU

    here's part of my code:

    if(event.getSource() == signupButton) {

    try {

    outFile1 = new PrintWriter ( new FileWriter("register.txt",true));
    outFile1.print(usernameField.getText()+" ");
    outFile1.print(password.getText() +"* ");
    outFile1.flush();
    outFile1.close();
    JOptionPane.showMessageDialog(null,"Data have been Saved");
    usernameField.setText("");
    password.setText("");

    }

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    25

Similar Threads

  1. Saving To A New Line Using A Text File
    By jadaleus in forum Advanced Java
    Replies: 10
    Last Post: 10-24-2008, 07:21 PM
  2. saving to a new line a text
    By jadaleus in forum Advanced Java
    Replies: 1
    Last Post: 10-20-2008, 06:10 PM
  3. Saving to a Text File
    By jadaleus in forum Advanced Java
    Replies: 2
    Last Post: 10-17-2008, 06:50 PM
  4. Reading in data from file line by line
    By bluekswing in forum New To Java
    Replies: 1
    Last Post: 10-02-2007, 12:19 AM

Posting Permissions

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