I can't seem to figure this one out. It seems like it would be easy...

I want the savePane JFrame to close when the user hits the saveButton.

Is there a line that I enter here? Or is there something I need to include in my saveListener class?

Any help would be great.


private class saveWindowListener implements ActionListener
		public void actionPerformed (ActionEvent e)

		out.println ("test");
		JFrame savePane=new JFrame("Save Menu");
		savePane.setLocation (450, 400);
		Container pane = savePane.getContentPane();
		pane.setLayout(new GridLayout( 4, 1, 1, 1));

		outputField = new JTextField("Enter Save Name here");
		savePane.add (outputField);
		saveButton = new JButton ("Save");
		savePane.add (saveButton);
		savePane.add( new JLabel( "Adjust Default Save path below " ) );
		savePathField = new JTextField("C:\\temp\\");
		savePane.add (savePathField);
		saveListener listenerSave = new saveListener ( );
		saveButton.addActionListener( listenerSave );

try :


Although that will not close the frame, it will hide it! hope this helps!