AdapterMenuItem adapter = new AdapterMenuItem(combo);
adapter.setManageFocus(true);
adapter.setCanActivate(true);
Menu menu = new Menu();
menu.add(adapter);
CheckMenuItem menuItem = new CheckMenuItem("I Like Cats");
menuItem.setChecked(true);
menu.add(menuItem);
menuItem = new CheckMenuItem("I Like Dogs");
menu.add(menuItem);
item1.setMenu(menu);
menu.add(new SeparatorMenuItem());
MenuItem radios = new MenuItem("Radio Options");
menu.add(radios);
Menu radioMenu = new Menu();
CheckMenuItem r = new CheckMenuItem("Blue Theme");
r.setGroup("radios");
r.setChecked(true);
radioMenu.add(r);
r = new CheckMenuItem("Gray Theme");
r.setGroup("radios");
radioMenu.add(r);
radios.setSubMenu(radioMenu);
MenuItem date = new MenuItem("Choose a Date");
date.setIcon(Resources.ICONS.calendar());
menu.add(date);
date.setSubMenu(new DateMenu());
toolBar.add(item1);
toolBar.add(new SeparatorToolItem());
SplitButton splitItem = new SplitButton("Split Button");
splitItem.setIcon(Resources.ICONS.list_items());
menu = new Menu();
menu.add(new MenuItem("<b>Bold</b>"));
menu.add(new MenuItem("<i>Italic</i>"));
menu.add(new MenuItem("<u>Underline</u>"));
splitItem.setMenu(menu);
toolBar.add(splitItem);
toolBar.add(new SeparatorToolItem());
ToggleButton toggle = new ToggleButton("Toggle");
toggle.toggle(true);
toolBar.add(toggle);
toolBar.add(new SeparatorToolItem());
Button scrollerButton = new Button("Scrolling Menu");
Menu scrollMenu = new Menu();
scrollMenu.setMaxHeight(200);
for (int i = 0; i < 40; i++) {
scrollMenu.add(new MenuItem("Item " + i));
}
scrollerButton.setMenu(scrollMenu);
toolBar.add(scrollerButton);