
Containers Hierarchy 10.3
Widgets are GUI elements which are used to interact with the user; the typical use of wid-
gets is to display content to the user in the form of text, images, menus, buttons, checkboxes
and radio buttons. Widgets are also used to get user inputs. JButton, JLabel, JScrollBar and
JCheckBox are examples of widgets in swing.
10.4 Containers Hierarchy
Every Java GUI application should be designed with a containment hierarchy, with the root of
the hierarchy being one of the root containers, that is, JFrame, JDialog or JApplet. For swing
applications, the root is always JFrame.
Figure 10.3 shows the containment hierarchy for a ...