The moose likes Swing / AWT / SWT / JFace and the fly likes Pls Help :- Jpanel doesn't show up. Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT / JFace
Reply Bookmark "Pls Help :- Jpanel doesn Watch "Pls Help :- Jpanel doesn New topic
Author

Pls Help :- Jpanel doesn't show up.

Garry Kalra
Ranch Hand

Joined: May 25, 2001
Posts: 111
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

Joined: May 16, 2001
Posts: 103
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

Joined: Sep 06, 2001
Posts: 22
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.
 
IntelliJ Java IDE
 
subject: Pls Help :- Jpanel doesn't show up.
 
Threads others viewed
No ClassDef found error
Can't close window
How to increase the width of JComboBox Display ??
JPanel doesn't show up
In Eclipse, my console window keeps disappearing
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com