Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Pls Help :- Jpanel doesn't show up.  RSS feed

 
Garry Kalra
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have created a panel and add it to the center of the window and call its show method. In its constructor i have set it visible.
Still the thing doesn't come up automatically until and unless i resize the window. I think some sorts of update is to be called. Can anyone help me with this.
Gaurav
 
Ali Hassaan
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this.invalidate();
getContentPane().add(panel);
this.validate();
this may help you if u trying to add panel in frame.........
or you can do this also
this.invalidate();
getContentPane().add(new JScrollPane(panel));
this.validate();
 
anandh
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah, most of the times this is because of missing validate() or missing repaint() call after adding/removing the component..I have faced this myself.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!