![]() | The Java Developer's Guide to Eclipse |
In Chapter 14, The Standard Widget Toolkit: A Lean Mean Widget Machine, you learned the fundamentals of SWT layout managers. The layout example
demonstrates a very simple example using all the layout managers and their
associated classes. Also see the companion projects
com.ibm.jdg2e.swt
and com.ibm.jdg2e.swt.snippets (containing nearly 250 SWT examples).

StackLayout. The Example Layouts
selection list allows you to select the layout to display.
GridLayout and FormLayout.

To run the example, launch the run-time instance of Eclipse (Run > Run As > Eclipse Application). Select Window > Show View > Other…> to open the selection dialog and then choose JDG2E> SWT Layouts Example. The view should display. Double click on the view title bar so the view occupies the entire workbench window. Select any layout from the list of available layouts.
The code is very easy to follow.
There is one class (LayoutView). All work is done in the
createPartControl method or methods called from createPartControl.
The example is contained in a single class in the com.ibm.jdg2e.swt.layouts package.
| Class | Description |
LayoutView |
Displays the view SWT Layouts Example |
© Copyright International Business Machines Corporation, 2004, 2006.
All rights reserved.