Action on clicking a "CLOSE" button.

Hi,I am fairly new to Java swing... I was hoping if someone could please let me know as to how to I handle an event on clicking a separate button labeled "CLOSE". I want the window to totally close on doing so. Thanks.
[239 byte] By [vijay.dixa] at [2007-11-27 6:58:47]
# 1
do you want the application to close/exit. if so, have as the code in actionPerformed()System.exit(0);if the application is to stay openwindow.dispose();
Michael_Dunna at 2007-7-12 18:49:18 > top of Java-index,Desktop,Core GUI APIs...
# 2
Thank you Michael .. worked perfectly!!
vijay.dixa at 2007-7-12 18:49:18 > top of Java-index,Desktop,Core GUI APIs...