A complete menu (3)
class MenuButton extends MenuItem {
MenuButton(String name) {
super(name);
}
public void postEvent(Event evt) {
if ((evt.id == Event.ACTION_EVENT)
&& action(evt, getLabel()))
return true;
return super.postEvent(evt);
}
public boolean action(Event evt, Object what) {
return false;
}
}