Close Button In A Gui

Sorry if this is a beginner code, but how would you add a close button to a GUI. I can't find a code to do so. I know how to make a button, but how would you make it close the whole program.
[198 byte] By [bcleva] at [2007-10-2 22:14:34]
# 1

Why did you repost the question here?

You where given the solution in your other posting on this topic:

http://forum.java.sun.com/thread.jspa?threadID=743971

The 3rd reply showed you how to write code in an ActionListener that has been added to a button.

And the 1st replay showed you the one line of code to add to the ActionListener.

Put the two together and you have your answer.

camickra at 2007-7-14 1:31:31 > top of Java-index,Desktop,Core GUI APIs...