home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  


Java AWT

Previous Chapter 19
java.awt Reference
Next
 

PopupMenu (New)

Name

PopupMenu (New)

[Graphic: Figure from the text]

Description

A PopupMenu is a menu that can be popped up on a Component.

Class Definition

public class java.awt.PopupMenu
    extends java.awt.Menu {
  
  // Constructors
  public PopupMenu();
  public PopupMenu (String label);
  
  // Instance Methods
  public synchronized void addNotify();
  public void show (Component origin, int x, int y);
}

Constructors

PopupMenu

public PopupMenu()

Description

Constructs a PopupMenu object.

public PopupMenu (String label)

Parameters

label

Text that appears on Menu.

Description

Constructs a PopupMenu object with the given label.

Instance Methods

addNotify

public synchronized void addNotify()

Overrides

Menu.addNotify()

Description

Creates a PopupMenu peer.

show

public void show (Component origin, int x, int y)

Parameters

origin

The Component upon which the PopupMenu will be displayed.

x

The PopupMenu's horizontal position on the component.

y

The PopupMenu's vertical position on the component.

Description

Shows the menu on the given Component. The origin specified must be contained in the hierarchy of the PopupMenu's parent component, which is determined by the call to Component.add(PopupMenu).


Previous Home Next
Polygon Book Index PrintGraphics (New)

Java in a Nutshell Java Language Reference Java AWT Java Fundamental Classes Exploring Java