[Image] EchoPoint
Helping you build truly dynamic and stateful web applications!
nothing

MenuBar, Menu and MenuItem    Click here for complete JavaDoc

The MenuBar, Menu and MenuItem components in combination provide dynamic drop down menus. 

The base class is MenuItem, from which Menu and MenuBar are derived.  All are in fact derived from Button.

To create a drop down menu, you create a MenuBar object, add Menu and MenuItem objects to it and then add the MenuBar to the container component.  Each MenuItem can have an action command string associated with it.  Any registered ActionListener will be informed when the user selects a menu item.

MenuBar provides some neat tricks itself.  It can be positioned anywhere on the screen, even over other components.  It can float down the page so that it is always visible.  It can also be made to display vertically down the screen.

[Image]


 

 

 

MenuBar mb = new MenuBar();

mb.setLeft(0);
mb.setTop(0);
mb.setHorizontalAlignment(EchoConstants.CENTER);

mn = new Menu(prefix + "Menu 1");
mb.add(mn);
mn.addActionListener(this);

mi = new MenuItem("M1 Sub Item 1");
mn.add(mi);
mn.add(new Separator());
mi.addActionListener(this);
mi.setActionCommand(mi.getText());

Client Browser Support :

All clients supported by the Echo Framework.


Home

SourceForge Logo

The EchoPoint project is kindly hosted by SourceForge