wood burning stoves 2.0*
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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: 19654
    
  18

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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Jpanel not displayed without minimizing JFrame
 
Similar Threads
Data refresh not happening in JTable
Is this a bug..?
How to implement editable field in table to restrict to accept fixed length
Layout Problems
JMenuBar in an Applet : Good vs Bad Code Practice?