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.

[247 byte] By [tutikashilpaa] at [2007-11-27 11:20:36]
# 1

Read the setDefaultCloseOperation(...) method of the JFrame API and choose the appropriate value.

camickra at 2007-7-29 14:43:38 > top of Java-index,Desktop,Core GUI APIs...
# 2

dispose();

or

[frame].dispose();

[edit]

assumes you are talking about a separate button to the one in the titlebar

Michael_Dunna at 2007-7-29 14:43:38 > top of Java-index,Desktop,Core GUI APIs...
# 3

yes,I have separate button from that I have with the default one.

tutikashilpaa at 2007-7-29 14:43:38 > top of Java-index,Desktop,Core GUI APIs...