Are you trying to close your window with the X button up in the corner, or with a java button on the GUI? If you want to close with the X button you have to add a WindowListener to the window that overrides the windowClosing() method. If you are using another button you have to add an ActionListener to that button.
-Nate
-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
Vipul Tangri
Greenhorn
Joined: Nov 09, 2000
Posts: 11
posted
0
Originally posted by Nathan Pruett: [B]To make your frame non-resizable, use:
Are you trying to close your window with the X button up in the corner, or with a java button on the GUI? If you want to close with the X button you have to add a WindowListener to the window that overrides the windowClosing() method. If you are using another button you have to add an ActionListener to that button.
-Nate[/B]
hi Nathan, i tried to close my GUI with the help of a button and i add a windowlistener to that button. i wrote public void actionPerformed(ActionEvent e) { if e.getSource()==button // button i want to use to close setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE) } but itdidn't work...
Paul Stevens
Ranch Hand
Joined: May 17, 2001
Posts: 2823
posted
0
And what happened when you used hide() or dispose()?