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:
Liked it! Share this Tutorial