// Change the primary style name
menuBar.setStylePrimaryName("myMenuBar");
// Add the original style names so the default styles apply
menuBar.addStyleName("gwt-MenuBar gwt-MenuBar-horizontal");
// Add some sub menus, each with a unique style name
for (int i = 0; i < 3; i++) {
MenuBar subMenu = new MenuBar(true);
subMenu.addItem("Item 1", emptyCommand);