aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Jpanel not displayed without minimizing JFrame Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Jpanel not displayed without minimizing JFrame" Watch "Jpanel not displayed without minimizing JFrame" New topic
Author

Jpanel not displayed without minimizing JFrame

Karnati Sudhakar
Ranch Hand

Joined: Aug 26, 2008
Posts: 270



When i select the radio button from the menu item ..i had to minimize and maximize the frame to see the label which is added to the panel.Please help me what is wrong? Something really missing..

Regards
Sudhakar
[ December 12, 2008: Message edited by: Karnati Sudhakar ]

Regards
Sudhakar
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19761
    
  20

Try calling revalidate() and/or repaint().


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Josh Britton
Greenhorn

Joined: Nov 26, 2008
Posts: 24
A couple ideas:

First, the size of your JFrame is BIG: could it be that the label is showing on a part of the frame that is off-screen?

Second, call validate on the JFrame after you add the panel:



Third, you shouldn't need to set the panel's visibility.

Last, don't forget to launch your JFrame using EventQueue.invokeLater:



Regards,

josh
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Jpanel not displayed without minimizing JFrame