FrameLayout class anchors each of its widgets at the top-left corner of itself. This means each child widget is drawn on top of the previous one. This can be used to simulate a
CardLayout from AWT by using
View.setVisible to show one of the children while hiding all the others (this is effectively how
FrameLayout actually paints all of its visible children, it can be used to layer the child widgets on top of each other. It produces very strange effects in some cases, while in other cases it can be amazingly useful. For example, darkening out all of the widgets except one can be achieved by using a semi-transparent
View object and a
FrameLayout. The inactive widgets are the first layer in the
FrameLayout, a semi-transparent ...