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.
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("");
}