hello, ok with my project im trying to use a single file to call multiple classes to pass information to the other JFrame classes. However when i run the runner file, it runs the first but will not close the class/window. I cant seem to find the code to close the window/class and proceed to the next class.

Here is the code for the runner.

Java Code:
import java.io.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.text.*;
import java.util.*;

public class GradeBookRunner
{
	String user = "";
	String fileName = "";
	int gradeValue = 0;
	int studentValue = 0;
	
	public static void main(String[] args)
	{
		
		GradeBookRunner n = new GradeBookRunner();
		
	}

	
	public GradeBookRunner()
	{
		TypeOfUser f = new TypeOfUser();
		f.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
		f.setSize(450,300);
		f.setTitle("Grade Book 2011");
		f.setResizable(false);
		f.setLocation(200,200);
		f.setVisible(true);
		
		user = TypeOfUser.newOrOld;
		if(user.equals("New"))
		{
			GatherNumbers g = new GatherNumbers();
			g.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
			g.setSize(450,300);
			g.setTitle("Grade Book 2011");
			g.setResizable(false);
			g.setLocation(200,200);
			g.setVisible(true);
			
			fileName = GatherNumbers.fileString;
			gradeValue = GatherNumbers.gradeValue;
			studentValue = GatherNumbers.studentValue;
			
			Grades h = new Grades(fileName, gradeValue, studentValue);
			h.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
			h.setSize(450,300);
			h.setTitle("Grade Book 2011");
			h.setResizable(false);
			h.setLocation(200,200);
			h.setVisible(true);
			
		} else if(user.equals ("Old"))
		{
			FileFind i = new FileFind();
			i.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
			i.setSize(450,300);
			i.setTitle("Grade Book 2011");
			i.setResizable(false);
			i.setLocation(200,200);
			i.setVisible(true);
			fileName = FileFind.fileString;
			gradeValue = FileFind.gradeValue;
			studentValue = FileFind.studentValue;
			//Grades(fileName, gradeValue, studentValue);?
		}
	}
}

This is the code for TypeOfUser
Java Code:
import java.io.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.text.*;
import java.util.*;

public class TypeOfUser extends JFrame implements ActionListener
{
	static String newOrOld = "";
	JFrame frame;
	
	JPanel user = new JPanel();
	JPanel blankSpace = new JPanel();
	JPanel welcome = new JPanel();
	
	JPanel fieldPanel = new JPanel();
	JPanel buttonPanel = new JPanel();
	
	JLabel NewOld = new JLabel("Are you a new User or Old?");
		JTextField txt = new JTextField(10);
	JLabel Welcome = new JLabel("Welcome to GradeBook 2011!");
	
	String Type[] = {"","New","Old"};
	JComboBox userType = new JComboBox(Type);
	
	JButton submitButton = new JButton("submit");

	
	public TypeOfUser()
	{
		
		try
		{
			UIManager.setLookAndFeel("com.sun.java.swing.plaf.motif.MotifLookAndFeel");
		}
		catch(Exception e)
		{
			JOptionPane. showMessageDialog(null, "The UIManager could not set the look and feel for this application.","Error", JOptionPane.INFORMATION_MESSAGE);
		}

		Container c = getContentPane();
		c.setLayout((new BorderLayout()));
		fieldPanel.setLayout(new GridLayout(11,2));
		FlowLayout rowSetup = new FlowLayout(FlowLayout.LEFT,10,3);
		
		userType.setBackground(Color.gray);
   	userType.setForeground(Color.black);
		
		user.add(NewOld);
		user.add(userType);
		
		buttonPanel.setLayout(new FlowLayout(FlowLayout.CENTER));
		
		fieldPanel.add(Welcome);
		fieldPanel.add(blankSpace);
		fieldPanel.add(user);
		
		buttonPanel.add(submitButton);
		
		c.add(fieldPanel, BorderLayout.CENTER);
		c.add(buttonPanel, BorderLayout.SOUTH);
		
		userType.addItemListener(new ItemListener()
		{
     		public void itemStateChanged(ItemEvent ie)
			{
  		   	String type = (String)userType.getSelectedItem();
		  		txt.setText(type);
      	}
   	 });
		
		submitButton.addActionListener(this);

		addWindowListener(
			new WindowAdapter()
			{	
				public void windowClosing(WindowEvent e)
				{
					int answer  = JOptionPane.showConfirmDialog(null, "Are you sure you want to exit", "File Submission", JOptionPane.YES_NO_OPTION);
					if(answer == JOptionPane.YES_OPTION)
						System.exit(1);
				}
			}
		);	
	}
	
	public void actionPerformed(ActionEvent e)
	{
	
		String arg = e.getActionCommand();
		if(checkFields())
		{
				newOrOld = txt.getText();
				TypeOfUser.closeWindow(); //<--- is my issue
		}
	}
	
	public boolean checkFields()
	{
		if ((txt.getText().compareTo("")<1))
		{
			JOptionPane.showMessageDialog(null, "You must complete all fields.", "Data Entry Error", JOptionPane.WARNING_MESSAGE);
			return false;
		}
		else
		{
			return true;
		}
	}
}