
SECTION 6
GUI Builder
Press Ctrl-Shift-8 (Mac: Command-Shift-8) to open the Component Palette; select GUI components
and drop them onto the JFrame. In this example, I added a JButton, a JLabel, and a JTextField. Now
right-click the JFrame and select Customize Layout from the context menu (shown in Figure 42).
76
© 2009 Sun Microsystems. All rights reserved.
This publication is protected by copyright. Please see page 2 for more details.
100 NetBeans
™ IDE Tips & Tricks
by Ruth Kusterer
The GridBag Customizer opens, as shown in Figure 43. With the GridBag Customizer you get
immediate visual feedback while you edit the properties of a GridBag layout. You can rearrange
components by dragging them with the mouse to another field in the grid. You can assign values
to insets, padding, weights, grid size, and anchoring for each component.
Whenever you create a GUI with rows and columns that fits the grid scheme, the GridBag
Customizer is a good choice.
FIGURE 42:
Customizing the
GridBag layout