closing my window
Hi,
I have close button on my frame.I dont want to use System.exit(0) to close the window.
I want to close only my window,If I use System.exit(0),its closing the whole application.How can I do this in the listener.
thanks.
Hi,
I have close button on my frame.I dont want to use System.exit(0) to close the window.
I want to close only my window,If I use System.exit(0),its closing the whole application.How can I do this in the listener.
thanks.
Read the setDefaultCloseOperation(...) method of the JFrame API and choose the appropriate value.
dispose();
or
[frame].dispose();
[edit]
assumes you are talking about a separate button to the one in the titlebar
yes,I have separate button from that I have with the default one.