hey everyone,
well i got a little problem im trying to write input from the JTextField into the file (file4.txt) but the problem is it keeps overwriting the text file each time i make input and any data ther was is changed in to new data.all i need is that it would add the new information below the old information.
any suggestions?

public void actionPerformed(ActionEvent e) {
String nameText = enterName.getText();
      BufferedWriter bufewr;
      bufewr         = new BufferedWriter(new FileWriter("file4.txt"));
      for (int i=0; i<1; i++)
      { bufewr.write(nameText);
        System.out.println("string= " + nameText);

    catch(IOException e)
    { System.err.println("Exception: " + e.getMessage());

any suggestion would be greatly appreciated
thank you

wow this was easy didn't expect that to be so simple thank you very much
thank YOU

This question has already been answered. Start a new discussion instead.