Class awt.Menu
All Packages This Package Previous Next
Class awt.Menu
java.lang.Object
|
+----awt.Component
|
+----awt.Menu
-
public class
Menu
-
extends Component
A Menu that is a component of a menu bar.
-
Version:
-
1.16 31 Jan 1995
-
Author:
-
Sami Shaio
-
title
-
-
Menu(String, MenuBar)
-
Constructs a new Menu with the given title.
-
Menu(String, MenuBar, boolean)
-
Constructs a new Menu with the given title.
-
addSeparator()
-
Adds a separator line to the menu at the current position.
-
dispose()
-
Destroys this menu.
-
hide()
-
Hides this menu.
-
nItems()
-
Returns the number of elements in this menu.
-
selected(int)
-
Override this method to handle any items that are selected.
-
show()
-
Shows this menu.
title
public String title
Menu
public Menu(String title,
MenuBar mb)
-
Constructs a new Menu with the given title. It will be placed
at the end of any existing menus in mb.
Menu
public Menu(String title,
MenuBar mb,
boolean tearOff)
-
Constructs a new Menu with the given title. The menu will be able
to be torn off if tearOff is true.
nItems
public int nItems()
-
Returns the number of elements in this menu.
addSeparator
public void addSeparator()
-
Adds a separator line to the menu at the current position.
show
public void show()
-
Shows this menu.
hide
public void hide()
-
Hides this menu.
dispose
public void dispose()
-
Destroys this menu.
-
Overrides:
-
dispose in class Component
selected
public void selected(int index)
-
Override this method to handle any items that are selected.
-
Parameters:
-
index
-
is the index of the item that was selected.
All Packages This Package Previous Next