In the The Standard Widget Toolkit: A Lean Mean Widget Machine lecture you learned the fundamentals of SWT layout managers. The layout solution demonstrates a very simple example using all four layout managers and their associated classes. Also see the companion project com.ibm.lab.soln.swt.

- The solution is contained in an a view named Soln: Layout Lab. Each layout is contained in a Group control and each group is layed out vertically using a FillLayout. The last two layouts involve a simple name and address form layed out using two different layout managers: GridLayout and FormLayout.
  "Soln: Layout Lab" View

## Running the Solution

To run the example, launch the run-time instance of Eclipse (Run > Run As > Run-time Workbench). Select Window > Show View > Other…. Expand Soln: Layouts and select Soln: Layouts Lab. The view should display. Double click on the view title bar so the view occupies the entire workbench window. Try resizing the window and observe. Only the row layout responds to resizing. Some information is written to the Console view of the launch instance of Eclipse when Button 1 is pressed from the row layout and the grid layout.

## Roadmap of the Solution

- The code is very easy to follow. Everything is done in the createPartControl method in the class LayoutView and methods called by it.

The example is contained in a single class in the `com.ibm.lab.soln.layouts` package.

Class | Description
LayoutView | Displays the Soln: SWT Lab view and its SWT widgets

© Copyright International Business Machines Corporation, 2003.
All rights reserved.