| <<< Border Layout | Index | Menus and Actions >>> |
GridLayout class arranges swing components in tabular format:
// Use grid with 2 rows and one column:
this.setLayout(new GridLayout(2, 1));
this.getContentPane().add(mRadioPanel);
this.getContentPane().add(mMainPanel);
this.pack(); // Auto-arrange frame layout
The following example demonstrates FrameRadioButtons class with two panels. GroupRadioButtons panel contains the radio buttons; another panel contains the push buttons, Change Color and Quit.
| <<< Border Layout | Index | Menus and Actions >>> |