Hi,
I have a simple Panel, that I add a set of other panels to dynamically..
I have a combo box that contains a list. Selecting an item forces a new
panel to be added below.
When I do this, the panel that is added does not display until I resize the
window manually.
I have tried all sorts of repaint(), update() etc, but no good.
I have seen this before but am racking my brains trying to remember how I
fixed it..
Code below.. Assume that _displayPanel is already sitting on the main Frame
using a borderlayout and was added using the CENTER parameter.
<snip>
private void showStudyPanel(int type){
_displayPanel.removeAll();
Panel p = _descriptors[type].getDisplayPanel();
if( p!= null){
System.out.println("ADDING PANEL!");
_displayPanel.add(p);
}
_displayPanel.invalidate();
_displayPanel.repaint();
}
</snip>
SPG - 15 Feb 2005 17:46 GMT
OK, Fixed it myself..
Added a
panel.paintAll(panel.getGraphics());
And it solved the prob.
> Hi,
>
[quoted text clipped - 23 lines]
> }
> </snip>