This section illustrates you how to create an Expand Bar.
SWT provides an application of creating a Expand Bar using the classes ExpandBar and ExpandItem. The class ExpandBar provides the layout of selectable expand bar items.
The layout.VerticalSpacing specifies the number of pixels between the bottom edge and the top edge. The method setHeight() of class ExpandItem sets the height of the Expand bar. The method setControl(composite) sets the control that is shown when the item is expanded. The method composite.computeSize(SWT.DEFAULT, SWT.DEFAULT).y) returns the preferred size.
Here is the code of ExpandBarExample.java
Output will be displayed as:
If you enjoyed this post then why not add us on Google+? Add us to your Circles
Liked it! Share this Tutorial
Discuss: Create Expand Bar in SWT
Post your Comment