src/share/classes/javax/swing/JMenu.java

Print this page




  59 
  60 /**
  61  * An implementation of a menu -- a popup window containing
  62  * <code>JMenuItem</code>s that
  63  * is displayed when the user selects an item on the <code>JMenuBar</code>.
  64  * In addition to <code>JMenuItem</code>s, a <code>JMenu</code> can
  65  * also contain <code>JSeparator</code>s.
  66  * <p>
  67  * In essence, a menu is a button with an associated <code>JPopupMenu</code>.
  68  * When the "button" is pressed, the <code>JPopupMenu</code> appears. If the
  69  * "button" is on the <code>JMenuBar</code>, the menu is a top-level window.
  70  * If the "button" is another menu item, then the <code>JPopupMenu</code> is
  71  * "pull-right" menu.
  72  * <p>
  73  * Menus can be configured, and to some degree controlled, by
  74  * <code><a href="Action.html">Action</a></code>s.  Using an
  75  * <code>Action</code> with a menu has many benefits beyond directly
  76  * configuring a menu.  Refer to <a href="Action.html#buttonActions">
  77  * Swing Components Supporting <code>Action</code></a> for more
  78  * details, and you can find more information in <a
  79  * href="http://java.sun.com/docs/books/tutorial/uiswing/misc/action.html">How
  80  * to Use Actions</a>, a section in <em>The Java Tutorial</em>.
  81  * <p>
  82  * For information and examples of using menus see
  83  * <a href="http://java.sun.com/doc/books/tutorial/uiswing/components/menu.html">How to Use Menus</a>,
  84  * a section in <em>The Java Tutorial.</em>
  85  * <p>
  86  * <strong>Warning:</strong> Swing is not thread safe. For more
  87  * information see <a
  88  * href="package-summary.html#threading">Swing's Threading
  89  * Policy</a>.
  90  * <p>
  91  * <strong>Warning:</strong>
  92  * Serialized objects of this class will not be compatible with
  93  * future Swing releases. The current serialization support is
  94  * appropriate for short term storage or RMI between applications running
  95  * the same version of Swing.  As of 1.4, support for long term storage
  96  * of all JavaBeans<sup><font size="-2">TM</font></sup>
  97  * has been added to the <code>java.beans</code> package.
  98  * Please see {@link java.beans.XMLEncoder}.
  99  *
 100  * @beaninfo
 101  *   attribute: isContainer true
 102  * description: A popup window containing menu items displayed in a menu bar.
 103  *




  59 
  60 /**
  61  * An implementation of a menu -- a popup window containing
  62  * <code>JMenuItem</code>s that
  63  * is displayed when the user selects an item on the <code>JMenuBar</code>.
  64  * In addition to <code>JMenuItem</code>s, a <code>JMenu</code> can
  65  * also contain <code>JSeparator</code>s.
  66  * <p>
  67  * In essence, a menu is a button with an associated <code>JPopupMenu</code>.
  68  * When the "button" is pressed, the <code>JPopupMenu</code> appears. If the
  69  * "button" is on the <code>JMenuBar</code>, the menu is a top-level window.
  70  * If the "button" is another menu item, then the <code>JPopupMenu</code> is
  71  * "pull-right" menu.
  72  * <p>
  73  * Menus can be configured, and to some degree controlled, by
  74  * <code><a href="Action.html">Action</a></code>s.  Using an
  75  * <code>Action</code> with a menu has many benefits beyond directly
  76  * configuring a menu.  Refer to <a href="Action.html#buttonActions">
  77  * Swing Components Supporting <code>Action</code></a> for more
  78  * details, and you can find more information in <a
  79  * href="http://docs.oracle.com/javase/tutorial/uiswing/misc/action.html">How
  80  * to Use Actions</a>, a section in <em>The Java Tutorial</em>.
  81  * <p>
  82  * For information and examples of using menus see
  83  * <a href="http://www.oracle.com/technetwork/java/index.html">How to Use Menus</a>,
  84  * a section in <em>The Java Tutorial.</em>
  85  * <p>
  86  * <strong>Warning:</strong> Swing is not thread safe. For more
  87  * information see <a
  88  * href="package-summary.html#threading">Swing's Threading
  89  * Policy</a>.
  90  * <p>
  91  * <strong>Warning:</strong>
  92  * Serialized objects of this class will not be compatible with
  93  * future Swing releases. The current serialization support is
  94  * appropriate for short term storage or RMI between applications running
  95  * the same version of Swing.  As of 1.4, support for long term storage
  96  * of all JavaBeans<sup><font size="-2">TM</font></sup>
  97  * has been added to the <code>java.beans</code> package.
  98  * Please see {@link java.beans.XMLEncoder}.
  99  *
 100  * @beaninfo
 101  *   attribute: isContainer true
 102  * description: A popup window containing menu items displayed in a menu bar.
 103  *