This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes close panel Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "close panel" Watch "close panel" New topic
Author

close panel

mark smith
Ranch Hand

Joined: Apr 05, 2005
Posts: 246
hi

on panel, i have a JTabbedPane

On this JTabbedPane, i have 2 panel



in the EntityInfoPanel, i have a button i would like to close my EntityPanel

i do



but that close only the JTabbedPane not EntityPanel

how to do it?

thanks
Rob Camick
Ranch Hand

Joined: Jun 13, 2009
Posts: 2152
    
    7
Panels don't close. That something JFrames and JDialogs do.

So I'm guessing your looking for:

mark smith
Ranch Hand

Joined: Apr 05, 2005
Posts: 246
my error... EntityPanel is on JDialog...

so in the button event of EntityInfoPanel i do: this.getTopLevelAncestor().setVisible(false); //a

i put an addWindowListener on the JDialog, windowClosing is not never called..... i thinking i could called after line //a
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: close panel
 
Similar Threads
refresh canvas, designer problem?
JTabPane Problem
Focus: cant find the relevant method
removing a painted component via paintComponent leaves a residue
JTabbedPane