Lightweight Components and Zorder

Zorder for lightweight components is determined in the same manner as zorder for heavyweight components.[4] Zorder is determined by the order in which lightweight components are added to their container. If more than one lightweight component is added to a container, the one that is added to the container first is displayed in front of all the other lightweights.

[4] For details, see “Components and Zorder”.

Figure 19-3 shows an applet containing three lightweight components and a single heavyweight component—a button. The zorder of the lightweights is determined by the order in which they are added to the applet. For example, the filmstrip lightweight is displayed in front of the frog lightweight because it is ...

Get Graphic Java™ 1.2, Volume I: AWT, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.