This example describes the Basics for building the Menu using GWT. The steps involved in Building the Menu Structure are described below:-
final Label label = new Label("Move the cursor over the
Here we are declaring label. Label is a widget that contains text.
Command cmd = new Command()
Command is an interface that encapsulates an action for execution. This Interface can be often implemented with an anonymous inner class.
Window.alert("Menu item have been selected")
This is an alert whenever an Menu item is selected.
Menu Bar File = new MenuBar(true)
Creating a Menu bar named File. A Menu bar can contain any number of items.
This is a method for adding item to the Menubar.Here we are adding New to the Menu bar named File
Output of the program
Liked it! Share this Tutorial