concept GridLayout in category java

appears as: GridLayout
Swt/Jface in Action: GUI Design with Eclipse 3.0

This is an excerpt from Manning's book Swt/Jface in Action: GUI Design with Eclipse 3.0.

The grid layout builds on the row layout model by allowing you to explicitly create multiple rows and columns. In effect, the grid layout offers a nicely partitioned bookcase with multiple shelves and clean divisions on each shelf to further organize your controls. Factor in a flexible grid data object, and the end result is that the grid layout is the most useful and widely used layout. Figure 6.5 shows a series of buttons, this time controlled by a GridLayout.

Figure 6.5. Buttons controlled by a GridLayout

Listing 6.4 demonstrates a simple grid layout example in the WidgetWindow framework. We create a GridLayout with four columns and allow the layout to create as many rows as necessary.