Design Patterns ..........................................................................
A Model-View-Controller Analysis of Swing Buttons .........
Border Layout ............................................................................
Text Input ..................................................................................................
Labels and Labeling Components ..........................................
Text Areas ...................................................................................
Choice Components ................................................................................
Radio Buttons .............................................................................
ptg18360597
664
Borders ........................................................................................
12.4.3
668
Combo Boxes ..............................................................................
12.4.4
672
Sliders ..........................................................................................
12.4.5
678
Menus ........................................................................................................
12.5
679
Menu Building ...........................................................................
12.5.1
682
Icons in Menu Items ..................................................................
12.5.2
683
Checkbox and Radio Button Menu Items ..............................
12.5.3
684
Pop-Up Menus ...........................................................................
12.5.4
686
Keyboard Mnemonics and Accelerators ................................
12.5.5
689
Enabling and Disabling Menu Items ......................................
12.5.6
694
Toolbars .......................................................................................
12.5.7
696
Tooltips ........................................................................................
12.5.8
699
Sophisticated Layout Management .......................................................
12.6
701
The Grid Bag Layout .................................................................
12.6.1
703
The
gridx
,
gridy
,
gridwidth
, and
gridheight
Parameters ...
12.6.1.1
703
Weight Fields ..............................................................
12.6.1.2
704
The
fill
and
anchor
Parameters ..................................
12.6.1.3
704
Padding .......................................................................
12.6.1.4
705
Alternative Method to Specify the
gridx
,
gridy
,
gridwidth
, and
gridheight
Parameters ............................
12.6.1.5
706
A Helper Class to Tame the Grid Bag
Constraints ..................................................................
12.6.1.6
713
Group Layout .............................................................................
12.6.2
723
Using No Layout Manager ......................................................
12.6.3
724
Custom Layout Managers ........................................................
12.6.4
729
Traversal Order ..........................................................................
12.6.5
730
Dialog Boxes .............................................................................................
12.7
731
Option Dialogs ...........................................................................
12.7.1
741
Creating Dialogs ........................................................................
12.7.2
746
Data Exchange ............................................................................
12.7.3
752
File Dialogs .................................................................................
12.7.4
764
Color Choosers ..........................................................................
12.7.5
770
Troubleshooting GUI Programs .............................................................
12.8
770
Debugging Tips .........................................................................
12.8.1
774
Letting the AWT Robot Do the Work .....................................
12.8.2
xv
Contents
From the Library of Hristo Dimov Hristov