Package java.awt |
![]() Previous |
![]() Java API |
![]() Index |
![]() Next |
public abstract class java.awt.MenuComponent extends java.lang.Object { // Constructors public MenuComponent(); // Methods public Font getFont(); public MenuContainer getParent(); public MenuComponentPeer getPeer(); protected String paramString(); public boolean postEvent(Event evt); public void removeNotify(); public void setFont(Font f); public String toString(); }
The abstract class MenuComponent is the superclass of all menu related components.
public MenuComponent()The default constructor.
public Font getFont()Return Value:
Returns the font used in this menu component, if there is one; null otherwise.
public MenuContainer getParent()Return Value:
Returns returns the menu component containing this menu component; null if this is the outermost component, the menu bar itself.
public MenuComponentPeer getPeer()Returns this menu component's peer. Every menu component has a peer associated with it. This peer allows the application to change the look of a menu component without changing its functionality.
Return Value:
Returns the menu component's peer.
protected String paramString()Returns the parameter string representing the state of this menu component. This string is useful for debugging.
Return Value:
Returns the parameter string of this menu component.
public boolean postEvent(Event evt)Posts an event to this menu component, by calling its handleEvent method. If handleEvent returns false, then post the event to the menu component's parent.
Return Value:
Returns true if this menu component or one of its parents handled the event; false otherwise.
Parameter Description evt the event
public void removeNotify()Notifies this menu component to destroy its peer.
public void setFont(Font f)Sets the font to be used for this menu component to the specified font. This font is also used by all subcomponents of the menu component, unless those subcomponents specify a different font.
Parameter Description f the font to be set
Return Value:
Returns a string representation of this menu component.
Overrides:
toString in class Object .