src/share/classes/java/awt/MenuBar.java

Print this page

        

*** 79,89 **** new AWTAccessor.MenuBarAccessor() { public Menu getHelpMenu(MenuBar menuBar) { return menuBar.helpMenu; } ! public Vector getMenus(MenuBar menuBar) { return menuBar.menus; } }); } --- 79,89 ---- new AWTAccessor.MenuBarAccessor() { public Menu getHelpMenu(MenuBar menuBar) { return menuBar.helpMenu; } ! public Vector<Menu> getMenus(MenuBar menuBar) { return menuBar.menus; } }); }
*** 92,102 **** * actual menus that will be part of the MenuBar. * * @serial * @see #countMenus() */ ! Vector menus = new Vector(); /** * This menu is a special menu dedicated to * help. The one thing to note about this menu * is that on some platforms it appears at the --- 92,102 ---- * actual menus that will be part of the MenuBar. * * @serial * @see #countMenus() */ ! Vector<Menu> menus = new Vector<>(); /** * This menu is a special menu dedicated to * help. The one thing to note about this menu * is that on some platforms it appears at the
*** 307,317 **** /* * This is called by the native code, so client code can't * be called on the toolkit thread. */ final Menu getMenuImpl(int i) { ! return (Menu)menus.elementAt(i); } /** * Gets an enumeration of all menu shortcuts this menu bar * is managing. --- 307,317 ---- /* * This is called by the native code, so client code can't * be called on the toolkit thread. */ final Menu getMenuImpl(int i) { ! return menus.elementAt(i); } /** * Gets an enumeration of all menu shortcuts this menu bar * is managing.
*** 319,332 **** * menu bar is managing. * @see java.awt.MenuShortcut * @since JDK1.1 */ public synchronized Enumeration<MenuShortcut> shortcuts() { ! Vector shortcuts = new Vector(); int nmenus = getMenuCount(); for (int i = 0 ; i < nmenus ; i++) { ! Enumeration e = getMenu(i).shortcuts(); while (e.hasMoreElements()) { shortcuts.addElement(e.nextElement()); } } return shortcuts.elements(); --- 319,332 ---- * menu bar is managing. * @see java.awt.MenuShortcut * @since JDK1.1 */ public synchronized Enumeration<MenuShortcut> shortcuts() { ! Vector<MenuShortcut> shortcuts = new Vector<>(); int nmenus = getMenuCount(); for (int i = 0 ; i < nmenus ; i++) { ! Enumeration<MenuShortcut> e = getMenu(i).shortcuts(); while (e.hasMoreElements()) { shortcuts.addElement(e.nextElement()); } } return shortcuts.elements();
*** 436,446 **** throws ClassNotFoundException, IOException, HeadlessException { // HeadlessException will be thrown from MenuComponent's readObject s.defaultReadObject(); for (int i = 0; i < menus.size(); i++) { ! Menu m = (Menu)menus.elementAt(i); m.parent = this; } } /** --- 436,446 ---- throws ClassNotFoundException, IOException, HeadlessException { // HeadlessException will be thrown from MenuComponent's readObject s.defaultReadObject(); for (int i = 0; i < menus.size(); i++) { ! Menu m = menus.elementAt(i); m.parent = this; } } /**