wood burning stoves
The moose likes Java in General and the fly likes Unloading a frame Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of The Software Craftsman this week in the Agile forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Unloading a frame" Watch "Unloading a frame" New topic

Unloading a frame

Richard Mendoza
Ranch Hand

Joined: Feb 26, 2003
Posts: 48
I have a frame and in it is a button named close. What I want I want is if I click on the button, it should unload the frame (not to terminate the whole program). What should I do? What command should I put on the actionPerformed method of the button?
Can anybody help me? Thanks!

Joe Ess

Joined: Oct 29, 2001
Posts: 9074

<frame object>.hide() or <frame object>.setVisible(false)

[How To Ask Questions On JavaRanch]
Ernest Friedman-Hill
author and iconoclast

Joined: Jul 08, 2003
Posts: 24189

hide or setVisible(false) will not free the resources used by the frame; they're a good choice if you're going to later show the frame again. Otherwise, use frame.dispose() to get rid of the frame altogether.

[Jess in Action][AskingGoodQuestions]
Have you tried LearnNowOnline? http://www.learnnowonline.com/
subject: Unloading a frame