File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 Android Security Essentials Live Lessons this week in the Android 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:
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Panels do not get repainted
 
Similar Threads
Revalidate problems
TicTacToe - Computer's move
JFileChooser: Exception while removing reference: java.lang.InterruptedException
Not able to change Background color of a component
Using a custom renderer for JComboBox