8130769: The new menu can't be shown on the menubar after clicking the "Add" button.
authorssadetsky
Tue, 28 Jul 2015 20:39:43 +0300
changeset 32118 5b0d9a83143b
parent 32117 800aef58b950
child 32119 1778956d7bee
8130769: The new menu can't be shown on the menubar after clicking the "Add" button. Reviewed-by: alexsch, serb, azvegint
jdk/src/java.desktop/share/classes/java/awt/MenuBar.java
--- a/jdk/src/java.desktop/share/classes/java/awt/MenuBar.java	Tue Jul 28 18:14:57 2015 +0300
+++ b/jdk/src/java.desktop/share/classes/java/awt/MenuBar.java	Tue Jul 28 20:39:43 2015 +0300
@@ -229,9 +229,11 @@
                 if (m.peer == null) {
                     m.addNotify();
                 }
+                menus.addElement(m);
                 peer.addMenu(m);
+            } else {
+                menus.addElement(m);
             }
-            menus.addElement(m);
             return m;
         }
     }