aspose file tools
The moose likes Swing / AWT / SWT and the fly likes getting rid of ContentPane/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 » Swing / AWT / SWT
Bookmark "getting rid of ContentPane/frame" Watch "getting rid of ContentPane/frame" New topic

getting rid of ContentPane/frame

Naf Rash
Ranch Hand

Joined: Feb 19, 2004
Posts: 85
I wanted to ask - how do you get rid of a frame/contentPane completely without causing a program to terminate? I have used setVisible(false) but just empties the content pane- i just want to discard it.
Ernest Friedman-Hill
author and iconoclast

Joined: Jul 08, 2003
Posts: 24189

Calling setVisible(false) on a JFrame completely removes it from the screen; calling dispose() on it ensures it could never be reused.
Your message suggests you've tried calling aFrame.getContentPane().setVisible(false). I'm impressed by your creativity, but don't do that.

[Jess in Action][AskingGoodQuestions]
Have you tried LearnNowOnline?
subject: getting rid of ContentPane/frame