This section illustrates you how to create a tree.
SWT allows an advantage of creating a tree. To represent the data in the hierarchical way, the class Tree is used. It provides the hierarchy of items.
The constructor of class Tree consists of shell and the style value. The class TreeItem represents the hierarchy of tree items in a tree by adding an item to the tree. Its constructor consists of parent, style value and the index.
The method setText() sets the text specified.
Here is the code of CreateTree.java
import org.eclipse.swt.SWT; |
Output will be displayed as

|
Recommend the tutorial |
Ask Questions? Discuss: Create Tree in SWT
Post your Comment