< prev index next >

src/java.desktop/share/classes/java/awt/Menu.java

Print this page


   1 /*
   2  * Copyright (c) 1995, 2016, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package java.awt;
  27 
  28 import java.awt.event.KeyEvent;
  29 import java.awt.peer.MenuPeer;
  30 import java.io.IOException;
  31 import java.io.ObjectInputStream;

  32 import java.util.Enumeration;

  33 import java.util.Vector;
  34 
  35 import javax.accessibility.Accessible;
  36 import javax.accessibility.AccessibleContext;
  37 import javax.accessibility.AccessibleRole;
  38 
  39 import sun.awt.AWTAccessor;
  40 
  41 /**
  42  * A {@code Menu} object is a pull-down menu component
  43  * that is deployed from a menu bar.
  44  * <p>
  45  * A menu can optionally be a <i>tear-off</i> menu. A tear-off menu
  46  * can be opened and dragged away from its parent menu bar or menu.
  47  * It remains on the screen after the mouse button has been released.
  48  * The mechanism for tearing off a menu is platform dependent, since
  49  * the look and feel of the tear-off menu is determined by its peer.
  50  * On platforms that do not support tear-off menus, the tear-off
  51  * property is ignored.
  52  * <p>


   1 /*
   2  * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package java.awt;
  27 
  28 import java.awt.event.KeyEvent;
  29 import java.awt.peer.MenuPeer;
  30 import java.io.IOException;
  31 import java.io.ObjectInputStream;
  32 import java.io.ObjectOutputStream;
  33 import java.util.Enumeration;
  34 import java.util.EventListener;
  35 import java.util.Vector;
  36 
  37 import javax.accessibility.Accessible;
  38 import javax.accessibility.AccessibleContext;
  39 import javax.accessibility.AccessibleRole;
  40 
  41 import sun.awt.AWTAccessor;
  42 
  43 /**
  44  * A {@code Menu} object is a pull-down menu component
  45  * that is deployed from a menu bar.
  46  * <p>
  47  * A menu can optionally be a <i>tear-off</i> menu. A tear-off menu
  48  * can be opened and dragged away from its parent menu bar or menu.
  49  * It remains on the screen after the mouse button has been released.
  50  * The mechanism for tearing off a menu is platform dependent, since
  51  * the look and feel of the tear-off menu is determined by its peer.
  52  * On platforms that do not support tear-off menus, the tear-off
  53  * property is ignored.
  54  * <p>


< prev index next >