MenuContainer
MenuContainer
is an interface implemented by the three menu containers: Frame
, Menu
, and MenuBar
; Java 1.1 adds a fourth, Component
. You should never need to worry about the interface since it does all its work behind the scenes for you. You will notice that the interface does not define an add()
method. Each type of MenuContainer
defines its own add()
method to add menus to itself.
MenuContainer Methods
- public abstract Font getFont ()
- The
getFont()
method should provide an object's font.MenuItem
implements this method, so all of its subclasses inherit it.MenuBar
implements it, too, whileFrame
gets the method fromComponent
. - public abstract boolean postEvent (Event e)
- The
postEvent()
method should postEvent
e
to the object.MenuComponent
implements this method, so all of its subclasses inherit it. (Frame
gets the method fromComponent
.) - public abstract void remove (MenuComponent component)
- The
remove()
method should remove theMenuComponent
component
from the object. Ifcomponent
was not contained within the object, nothing should happen.