changeset 8650:0f6def68b385

8130769: The new menu can't be shown on the menubar after clicking the "Add" button. Reviewed-by: serb
author mcherkas
date Wed, 25 Jan 2017 18:16:48 +0300
parents b957106dd73f
children e1ec864c1548
files src/share/classes/java/awt/MenuBar.java
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/java/awt/MenuBar.java	Thu Apr 20 06:12:51 2017 +0100
+++ b/src/share/classes/java/awt/MenuBar.java	Wed Jan 25 18:16:48 2017 +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;
         }
     }