changeset 12605:a22d8954a800

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 e1a11fc871de
children c0f664ed780a
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	Tue Jan 24 22:39:49 2017 +0300
+++ 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;
         }
     }