Java AWT

Previous Chapter 19
java.awt Reference
Next
 

MenuComponent

Name

MenuComponent

[Graphic: Figure from the text]

Description

The abstract MenuComponent class represents the parent of all menu GUI components.

Class Definition

public abstract class java.awt.MenuComponent
    extends java.lang.Object
    implements java.io.Serializable {
  
  // Instance Methods
  public final void dispatchEvent (AWTEvent e); (New)
  public Font getFont();
  public String getName(); (New)
  public MenuContainer getParent();
  public MenuComponentPeer getPeer(); (Deprecated)
  public boolean postEvent (Event e);
  public void removeNotify();
  public void setFont (Font f);
  public void setName (String name); (New)
  public String toString();
  
  // Protected Instance Methods
  protected String paramString(); (New)
  protected void processEvent (AWTEvent e); (New)
}

Instance Methods

dispatchEvent

public final void dispatchEvent (AWTEvent e)

Parameters

e

The AWTEvent to process.

Description

Tells the menu component to deal with the AWTEvent e.

getFont

public Font getFont()

Returns

The font for the current MenuComponent.

getName

public Font getName() (New)

Returns

The name for the current MenuComponent.

getParent

public MenuContainer getParent()

Returns

The parent MenuContainer for the MenuComponent.

getPeer

public MenuComponentPeer getPeer() (New)

Returns

A reference to the MenuComponent's peer.

postEvent

public boolean postEvent (Event e)

Parameters

e

Event instance to post to component.

Returns

Ignored for menus.

Description

Tells the Frame that contains the MenuBar containing the MenuComponent to deal with Event.

removeNotify

public void removeNotify()

Description

Removes peer of MenuComponent's subclass.

setFont

public void setFont (Font f)

Parameters

f

New font for MenuComponent.

Description

Changes the font of the label of the MenuComponent.

setName

public void setName (String name) (New)

Parameters

name

New name for MenuComponent.

Description

Changes the name of the MenuComponent.

toString

public String toString()

Returns

A string representation of the MenuComponent object.

Overrides

Object.toString()

Protected Instance Methods

paramString

protected String paramString() (New)

Returns

String with current settings of MenuComponent.

Overrides

Component.paramString()

Description

Helper method for toString() to generate string of current settings.

processEvent

protected void processEvent (AWTEvent e) (New)

Parameters

e

The event to process.

Description

Low-level AWTEvents are passed to this method for processing.

See Also

Event, Font, MenuBar, MenuComponentPeer, MenuContainer, MenuItem, Object, Serializable, String


Previous Home Next
MenuBar Book Index MenuContainer

Java in a Nutshell Java Language Reference Java AWT Java Fundamental Classes Exploring Java
This HTML Help has been published using the chm2web software.