Java™ Platform
Standard Ed. 8
java.awt
Class MenuComponent
-
-
Constructor Summary
Constructors
| Constructor |
Description |
MenuComponent() |
Creates a MenuComponent.
|
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods
| Modifier and Type |
Method |
Description |
void |
dispatchEvent(AWTEvent e) |
Delivers an event to this component or one of its sub components.
|
AccessibleContext |
getAccessibleContext() |
Gets the AccessibleContext associated with
this MenuComponent.
|
Font |
getFont() |
Gets the font used for this menu component.
|
String |
getName() |
Gets the name of the menu component.
|
MenuContainer |
getParent() |
Returns the parent container for this menu component.
|
java.awt.peer.MenuComponentPeer |
getPeer() |
Deprecated.
As of JDK version 1.1,
programs should not directly manipulate peers.
|
protected Object |
getTreeLock() |
Gets this component's locking object (the object that owns the thread
synchronization monitor) for AWT component-tree and layout
operations.
|
protected String |
paramString() |
Returns a string representing the state of this
MenuComponent.
|
boolean |
postEvent(Event evt) |
|
protected void |
processEvent(AWTEvent e) |
Processes events occurring on this menu component.
|
void |
removeNotify() |
Removes the menu component's peer.
|
void |
setFont(Font f) |
Sets the font to be used for this menu component to the specified
font.
|
void |
setName(String name) |
Sets the name of the component to the specified string.
|
String |
toString() |
Returns a representation of this menu component as a string.
|
-
-
Method Detail
-
getPeer
@Deprecated
public java.awt.peer.MenuComponentPeer getPeer()
Deprecated. As of JDK version 1.1,
programs should not directly manipulate peers.
-
postEvent
@Deprecated
public boolean postEvent(Event evt)
Posts the specified event to the menu.
This method is part of the Java 1.0 event system
and it is maintained only for backwards compatibility.
Its use is discouraged, and it may not be supported
in the future.
- Parameters:
evt - the event which is to take place
-
paramString
protected String paramString()
Returns a string representing the state of this
MenuComponent. This method is intended to be used
only for debugging purposes, and the content and format of the
returned string may vary between implementations. The returned
string may be empty but may not be null.
- Returns:
- the parameter string of this menu component
-
getAccessibleContext
public AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with
this MenuComponent.
The method implemented by this base class returns null.
Classes that extend MenuComponent
should implement this method to return the
AccessibleContext associated with the subclass.
- Returns:
- the
AccessibleContext of this
MenuComponent
- Since:
- 1.3
Java™ Platform
Standard Ed. 8
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2026, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.