This section illustrates you how to create a ToolBar in SWT.
To create a ToolBar , we have used the class ToolBar. The method setBounds() sets the size and location of toolBar. The class ToolItem adds the item to the ToolBar. The SWT.PUSH creates the toolItem in the form of button on the toolBar. The method setText() of this class sets the text to the toolItem. We have used the Listener class to display the selected toolItem on the console.
Here is the code of ToolBarExample.java
|
Output will be displayed as:

|
Recommend the tutorial |
Ask Questions? Discuss: Create a ToolBar
Post your Comment