java.awt

Class PopupMenu

public class PopupMenu extends Menu

This class implement an AWT popup menu widget
Nested Class Summary
protected classPopupMenu.AccessibleAWTPopupMenu
Constructor Summary
PopupMenu()
Initializes a new instance of PopupMenu.
PopupMenu(String label)
Initializes a new instance of PopupMenu with the specified label.
Method Summary
voidaddNotify()
Creates this object's native peer.
AccessibleContextgetAccessibleContext()
Gets the AccessibleContext associated with this PopupMenu.
voidshow(Component component, int x, int y)
Displays this popup menu at the specified coordinates relative to the specified component.

Constructor Detail

PopupMenu

public PopupMenu()
Initializes a new instance of PopupMenu.

Throws: HeadlessException If GraphicsEnvironment.isHeadless() returns true.

PopupMenu

public PopupMenu(String label)
Initializes a new instance of PopupMenu with the specified label.

Parameters: label The label for this popup menu.

Throws: HeadlessException If GraphicsEnvironment.isHeadless() returns true.

Method Detail

addNotify

public void addNotify()
Creates this object's native peer.

getAccessibleContext

public AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this PopupMenu. The context is created, if necessary.

Returns: the associated context

show

public void show(Component component, int x, int y)
Displays this popup menu at the specified coordinates relative to the specified component.

Parameters: component The component to which the display coordinates are relative. x The X coordinate of the menu. y The Y coordinate of the menu.