Two Laptop Bag*
The moose likes Swing / AWT / SWT and the fly likes repaint the frame Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "repaint the frame" Watch "repaint the frame" New topic
Author

repaint the frame

arona kosari
Greenhorn

Joined: Oct 28, 2006
Posts: 19
Hi.
I use frame and panel in my program,but when i run it,i must at first resize the frame too see it's panel.
I use repaint method too,but anything will change.
I'm wainting for your guidence.
Thanking you in anticipation.
Arona
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
generally indicates you have setVisible(true) in the wrong spot

frame.setVisible(true);
frame.add(panel);

should be

frame.add(panel);
frame.setVisible(true);
arona kosari
Greenhorn

Joined: Oct 28, 2006
Posts: 19
Thanks a lot.That was my problem.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: repaint the frame