JPanel - setVisible(true)
The usual way to do such things is to use a CardLayout. That layout
manager is exactly made for switching between a number of panels.
It works by accident. More precisely, the setVisible() just happens to
triggers the revalidation and repainting of the component. The right way
to do it would be to invalidate, validate, and possibly also to repaint.
But the CardLayout would be a much better choice.
/Thomas
--
The comp.lang.java.gui FAQ:
ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/computer-lang/java/gui/faq
|