Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Jpanel not displayed without minimizing JFrame

 
Karnati Sudhakar
Ranch Hand
Posts: 270
Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


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 ]
 
Rob Spoor
Sheriff
Pie
Posts: 20555
57
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try calling revalidate() and/or repaint().
 
Josh Britton
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic