• Post Reply Bookmark Topic Watch Topic
  • New Topic

Closing a panel  RSS feed

 
Mythily Jaganathan
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I have to close(exit) a JPanel without using System.exit() method.
Please help me to solve this problem.

Thanks in advance,
Mythily
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
is it the contentPane for a dialog/frame?
if so, use the dialog/frame's dispose()
 
Mythily Jaganathan
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

It is not a contentpane. It is a panel with griddedbag layout.

Thanks
Mythily
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
all you can do is remove it from its container.

then, depending on container type, you call
validate();
or
revalidate();

and, sometimes a call to repaint() is also required
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!