The Java Developer's Guide to EclipseThe Java Developer's Guide to Eclipse

In Chapter 14, The Standard Widget Toolkit: A Lean Mean Widget Machine, you learned the fundamentals of SWT. This SWT widgets example demonstrates some commonly used widgets (Button, Composite, Display, FileDialog, Font, Group, List, ProgressBar, Shell, and StyledText) and their event listeners. It also demonstrates synchronization of UI and non-UI threads using the Display class. Also see the companion projects com.ibm.jdg2e.swt.layouts and com.ibm.jdg2e.swt.snippets (containing nearly 250 SWT examples).:

Running the Example

To run the example, make sure the project com.ibm.jdg2e.swt is in your workspace. From the Plug-in Development perspective, launch the run-time instance of Eclipse (Run > Run As > Eclipse Application) . Select Window > Show View > Other… Then, expand JDG2E and select SWT Example. 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 Example

The example is contained in a single class in the com.ibm.jdg2e.swt package.

Class Description
SWTView Displays the view JDG2E: SWT Example

© Copyright International Business Machines Corporation, 2003, 2004, 2006. All Rights Reserved.
Code or samples provided herein are provided without warranty of any kind.