Im trying to add a list of words taken off the end user Via a JOptionPane input menu and store them in a text file without overwriting whats already there. eg of the txt file
bell cool hello now java compile
The problem I have is that it keeps overwriting what I have Any help??
  import javax.swing.JDialog;
  import java.util.Arrays;
  import javax.swing.*;
import java.util.*;
import java.io.*;
public class write
{
public static void main(String [] args) throws IOException
{
    PrintWriter out = new PrintWriter(aFileWriter);
 String word = JOptionPane.showInputDialog(null, "Enter a word");
  out.print(word);
  out.close();
  aFileWriter.close();
 }
 }
ok so now its appending the file but not moving to a new line for a new word??
 
     
    