Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Unloading a frame

 
Richard Mendoza
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!

Richard
 
Joe Ess
Bartender
Posts: 9280
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<frame object>.hide() or <frame object>.setVisible(false)
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24211
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic