
12.15 Using Panels to Nest Components 907
68 }
69 }
70
71 public static void main( String [ ] args )
72 {
73 BridgeBiddingClient bbGui = new BridgeBiddingClient( );
74 bbGui.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
75 }
76 }
EXAMPLE 12.20 Using BorderLayout to Illustrate Bridge Bidding Order
12.15 Using Panels to Nest Components
Components can be nested. Indeed, since the JComponent class is a subclass
of the Container class, a JComponent object is a Container object as well. As
such, it can contain other components. We can use this feature to achieve
more precise layouts.
The JPanel class is a general-purpose container, or a panel, and is typi-