This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Swing / AWT / SWT and the fly likes Panels do not get repainted 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 "Panels do not get repainted" Watch "Panels do not get repainted" New topic
Author

Panels do not get repainted

Sam Codean
Ranch Hand

Joined: Feb 26, 2006
Posts: 194
I have a reusable class called as DuplicatorPanel. This class has two add/ remove buttons like in Mac if you are familiar.

The problem is that the screen gets updated with an extra row in case i have a main method in Duplicator itself. However if i have that in another panel as in HyperlinkBuilder then it does not repaint itself.

Please can someone help ?



This is another class that calls the above



-Sam Codean<br />SCJP 1.4 (98%)<br />SCJD 5.0 (87.5%)
Craig Wood
Ranch Hand

Joined: Jan 14, 2004
Posts: 1535
Add a call to revalidate in this method:
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Panels do not get repainted