Package java.awt Previous
Previous
Java API
Java API
Index
Index
Next
Next

Class MenuComponent

Constructors , Methods

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.


Constructors


MenuComponent

public MenuComponent() 

The default constructor.


Methods


getFont

public Font getFont() 

Return Value:

Returns the font used in this menu component, if there is one; null otherwise.


getParent

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.


getPeer

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.


paramString

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.


postEvent

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.

ParameterDescription
evt the event


removeNotify

public void removeNotify() 

Notifies this menu component to destroy its peer.


setFont

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.

ParameterDescription
f the font to be set


toString

Return Value:

Returns a string representation of this menu component.

Overrides:

toString in class Object .



Top© 1996 Sun Microsystems, Inc. All rights reserved.