An implementation of a menu -- a popup window containing JMenuItems that
is displayed when the user selects an item on the JMenuBar. In addition
to JMenuItems, a JMenu can also contain JSeparators.

In essence, a menu is a button with an associated JPopupMenu.
When the "button" is pressed, the JPopupMenu appears. If the
"button" is on the JMenuBar, the menu is a top-level window.
If the "button" is another menu item, then the JPopupMenu is
"pull-right" menu.

For the keyboard keys used by this component in the standard Look and
Feel (L&F) renditions, see the
JMenu key assignments.

Warning:
Serialized objects of this class will not be compatible with
future Swing releases. The current serialization support is appropriate
for short term storage or RMI between applications running the same
version of Swing. A future release of Swing will provide support for
long term persistence.

setSelected

b - a boolean value -- true to select the menu and
open it, false to unselect the menu and close it

isPopupMenuVisible

public boolean isPopupMenuVisible()

Returns true if the menu's popup window is visible.

Returns:

true if the menu is visible, else false

setPopupMenuVisible

public void setPopupMenuVisible(boolean b)

Set the visibility of the Menu's popup portion. The popup
may only be made visible if the menu is itself showing on
the screen.

Parameters:

b - a boolean value -- true to make the menu visible,
false to hide it

getDelay

public int getDelay()

Returns the suggested delay before the menu's PopupMenu is popped up or down.
Each look and feel may determine its own policy for observing the delay
property. In most cases, the delay is not observed for top level menus
or while dragging.

Returns:

an int -- the number of milliseconds to delay

setDelay

public void setDelay(int d)

Sets the suggested delay before the menu's PopupMenu is popped up or down.
Each look and feel may determine its own policy for observing the delay
property. In most cases, the delay is not observed for top level menus
or while dragging.

paramString

Returns a string representation of this JMenu. 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.

Submit a bug or featureJava, Java 2D, and JDBC are a trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries.Copyright 1993-1999 Sun Microsystems, Inc. 901 San Antonio Road,Palo Alto, California, 94303, U.S.A. All Rights Reserved.