My code is
VerticalPanel v1 = new VerticalPanel();
Command comm = new Command() {
@Override
public void execute() {
// How i know that which menu item is cliked
}
};
MenuBar menu = new MenuBar();
menu.setWidth("500px");
menu.setAnimationEnabled(true);
menu.setAutoOpen(true);
menu.addSeparator();
MenuBar fileBar = new MenuBar(true);
MenuBar editBar = new MenuBar(true);
fileBar.addItem(new MenuItem("New", comm));
fileBar.addSeparator();
fileBar.addItem(new MenuItem("Open", comm));
fileBar.addItem(new MenuItem("Save", comm));
editBar.addItem("Edit 11", comm);
editBar.addItem("Edit 11", comm);
menu.addItem(new MenuItem("File", fileBar));
menu.addItem(new MenuItem("Edit", editBar));
v1.add(menu);
please help me