Using GridBag layout

You can use the AWT GridBag layout with Swing and AWT containers to arrange components using a powerful and flexible grid arrangement.

The GridBag layout manager arranges its components in rows and columns. The GridBagConstraints object contains information about the row and column where a component is placed, the number of columns the component should span, and how the component should be sized and positioned within the column.

The visual editor uses a visual grid and other visual cues to help you see where each component is placed in relationship to other components. You can use the Design view to set many of the constraints on components in a GridBag. The Properties view also gives you access to the available properties to control the placement of a component.

Parent topic: Swing and AWT layout managers

Related concepts
Layout managers and containers

Related tasks
Using BorderLayout
Using BoxLayout
Using CardLayout
Using FlowLayout
Using GridLayout (AWT)

(C) Copyright IBM Corporation 1999, 2004. All Rights Reserved.