JPanel repack



I'm using a JPanel to hold a variable number of components.

When the number of components changes, I do a JPanel.removeAll() and
then loop through the components doing a JPanel.add().

When I do this, the on-screen display ends up empty. If I then grab
the surrounding frame and change its size, the correct display appears.

I've tried a JPanel.repaint(), but that doesn't help. It looks like I
need to force a more thurough recalculation and redraw, but I'm not
sure how to do that.

I suspect I could do a Frame.pack(), but I'd like to keep it at the
JPanel level if possible.

Any help is appreciated,

Rob

.