In the SWT lecture you learned the fundamentals of SWT. The SWT widgets solution demonstrates some commonly used widgets (Button, Composite, Display, FileDialog, Font, Group, List, ProgressBar, Shell, and Styled Text) and their event listeners. It also demonstrates synchronization of UI and non-UI threads using the Display class. Also see the companion project com.ibm.lab.soln.layouts.

- The solution is contained in an a view that looks like this.

  The "Soln: SWT Lab" View

## Running the Solution

To run the example, in the Plug-in Development perspective, launch the run-time instance of Eclipse (Run > Run As > Run-time Workbench) . Select Window > Show View > Other… Then, expand Soln: SWT and select Soln: SWT Lab. The view should display. Double click on the view title bar so the view occupies the entire workbench window. In several cases, when you interact with the widgets in the view, information is displayed in the Console view of the launch instance of Eclipse.

## Roadmap of the Solution

- An Eclipse view is used as the widget container. You will learn more about views in a separate topic. Start your investigation of the code with the open method in the SWTView class.

- The Buttons group demonstrates how to define buttons and respond to button selections.

- The Styled Text group presents a simple StyledText text widget with its own Font. A ModifyListener and ControlListener are associated with the widget. The font must follow widget disposal requirements.

- The List group populates an SWT List widget and illustrates the use of SWT style bits.

- The Thread Synchronization group illustrates the use of a ProgressBar widget and the use of the Display.sync and Display.async methods to control UI and non-UI thread interaction.

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

Class | Description
`SWTView` | Displays the view Soln: SWT Lab

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