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...