Java Reference
In-Depth Information
East: two labels, a slider, and
a combo box with vertical
spacing in a box layout
The entire interface is governed by a
border layout with a panel in each area.
North:
two labels
West: four smaller panels
in a vertical box layout.
One panel for each label/text
field combination and another
for the gender radio buttons
Center: several check boxes,
a label, and a text field
South: two buttons
preceded by
horizontal glue
in a box layout
FIGURE 7.12 The containment hierarchy of a GUI
JFrame
JPanel
Entire Interface
(Border Layout)
JPanel
North - Title and Directions
(Vertical Box Layout)
JPanel
West - Name and Gender
(Vertical Box Layout)
JPanel
Center - Hobbies
(Vertical Box Layout)
JPanel
East - Age and Salary
(Vertical Box Layout)
JPanel
South - Clear and Submit
(Horizontal Box Layout)
JCheckBox
(quantity : 6)
JLabel
JLabel
JButton
JLabel
JSlider
JButton
JLabel
JLabel
Glue
JTextField
JComboBox
JPanel
First Name
(Horizontal Box Layout)
JPanel
Last Name
(Horizontal Box Layout)
JPanel
Middle Initial
(Horizontal Box Layout)
JPanel
Gender
(Vertical Box Layout)
JLabel
JLabel
JLabel
JRadioButton
JTextField
JTextField
JTextField
JRadioButton
FIGURE 7.13 The containment hierarchy tree
Search WWH ::




Custom Search