Hi I am running through this program and I am getting no errors but the problem is the output to my text file. When I click register the keys/values in the JTextFields should get written to the txt file "users.txt". The program works well the first time I start it up but when I start it again and send the keys/values to the file the same key and value from the first time pop up and so forth through each iteration of my program.

Java Code:
package piced;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Enumeration;
import java.util.Hashtable;

import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;

public class Register {

	JFrame frame = new JFrame("Registration");
	JPanel panel = new JPanel();
	JButton exit = new JButton("Exit");
	JButton regi = new JButton("Register");
	JLabel lab1 = new JLabel("Enter Name: ");
	JTextField name1 = new JTextField();
	JLabel lab2 = new JLabel("Confirm Name: ");
	JTextField name2 = new JTextField();
	JLabel lab3 = new JLabel("Enter Password: ");
	JTextField pass1 = new JTextField();
	JLabel lab4 = new JLabel("Confirm Password: ");
	JTextField pass2 = new JTextField();
	static Hashtable<String, String> users = new Hashtable<String, String>();
	static File file = new File("/Users/eric.manget/Desktop/users.txt");

	public Register() {

		GridLayout lay = new GridLayout(6, 1);

		panel.setLayout(lay);

		panel.add(lab1);
		panel.add(name1);
		panel.add(lab2);
		panel.add(name2);
		panel.add(lab3);
		panel.add(pass1);
		panel.add(lab4);
		panel.add(pass2);
		panel.add(new JLabel(""));
		panel.add(new JLabel(""));
		panel.add(regi);
		panel.add(exit);
		frame.add(panel);
		read();
		frame.setSize(280, 200);
		frame.setResizable(false);
		frame.setVisible(true);

		exit.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent actionEvent) {

				frame.dispose();

			}
		});

		regi.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent actionEvent) {

				if (name1.getText().equals(name2.getText())) {
					if (pass1.getText().equals(pass2.getText())) {

						String key = name1.getText();
						String value = pass1.getText();

						if (users.containsKey(key) == false) {

							if (key.equals("") == false) {
								if (value.equals("") == false) {

									users.put(key, value);
									Confirm("CONFIRM: If you continue program will close.",
											310, 80);

								} else {

									Error("ERROR: Please write a password.",
											330, 50);

								}

							} else {

								Error("ERROR: Please write a name.", 330, 50);

							}

						} else {

							Error("ERROR: There is already a user with that name.",
									330, 50);

						}
					} else {

						Error("ERROR: Passwords are not equal to each other.",
								320, 50);

					}

				} else {

					Error("ERROR: Names are not equal to each other.", 300, 50);

				}

			}
		});

	}

	public void Error(String error, int width, int height) {

		JFrame err1 = new JFrame("Error");
		JPanel perr = new JPanel();

		perr.add(new JLabel(error));
		err1.add(perr);

		err1.setResizable(false);
		err1.setSize(width, height);
		err1.setVisible(true);

	}

	public void Confirm(String confirm, int width, int height) {

		final JFrame err1 = new JFrame("Error");
		JPanel perr = new JPanel();
		JButton yes = new JButton("Continue");
		JButton no = new JButton("Back");

		perr.add(new JLabel(confirm));
		perr.add(yes);
		perr.add(no);
		err1.add(perr);
		err1.setResizable(false);
		err1.setSize(width, height);
		err1.setVisible(true);

		yes.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent actionEvent) {

				write();
				System.exit(0);

			}
		});

		no.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent actionEvent) {

				err1.dispose();

			}
		});

	}

	public void write() {

		try {

			FileWriter outFile = new FileWriter(file, true);
			PrintWriter out = new PrintWriter(outFile);

			Enumeration k = users.keys();
			while (k.hasMoreElements()) {

				String key = (String) k.nextElement();
				String output = key + ";" + users.get(key) + "\n";

				out.write(output);
				out.close();

			}

		} catch (IOException e) {

			Error("ERROR: User database not found.", 300, 46);

		}

	}

	public void read() {

		try {

			BufferedReader in = new BufferedReader(new FileReader(file));
			String str;

			String str1;
			String str2;
			users = new Hashtable<String, String>();
			while ((str = in.readLine()) != null) {
				int k = str.indexOf(';');
				if (k > 0) {

					str1 = str.substring(0, k);
					str2 = str.substring(k + 1);

					users.put(str1, str2);
				}

			}

		} catch (Exception e) {

			Error("ERROR: Could not read from users database.", 300, 60);

		}

	}

}