0

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.

Thanks

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

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

		savePane.setVisible(true);
					
		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 );
			
			
	}
		
}
2
Contributors
1
Reply
2
Views
9 Years
Discussion Span
Last Post by majestic0110
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.