Use GridLayout (SWT)

You can use the GridLayout with SWT composites to arrange components using a powerful and flexible grid arrangement.

The SWT GridLayout layout manager arranges its components, or widgets, in rows and columns. As each component is added, a new cell is added from left to right to accommodate the new component, and new rows are automatically added as necessary. For example, a Grid layout with three columns requires two rows to hold four widgets. This can become more complex because each component can bet set to span cells vertically and horizontally.

Because of its visual grid and placement indicators, the visual editor makes it easy to determine exactly where widgets will be located within the grid and in relation to other widgets.

To work with a SWT composite that is using Grid layout:

 

Parent topic

SWT layout managers

 

Related concepts

Layout managers and containers

 

Related tasks

Using FillLayout
Using FormLayout
Using RowLayout