Saturday, April 19, 2003 02:07 PM
The children of a Container
are ordered front to back (child at index 0 is in front of all the others. Child at the last index is behind all
others). To bring a Component
to the front you need to remove
from its parent and add it back to its parent with the correct index. For example the following code will bring the 5th child to the front (on top of all its siblings ):
Component child = parent.remove (4);
parent.add (child, 0);
See the manual page for Container
for more information.
Also note that you may have to revalidate ()
and repaint ()
the parent for the change to become visible.