From 0b9ef5a41c86751db7eb86c4d6c678e9e6834e7b Mon Sep 17 00:00:00 2001 From: mcherkas Date: Wed, 25 Jan 2017 18:16:48 +0300 Subject: [PATCH] 8130769: The new menu can't be shown on the menubar after clicking the "Add" button. Reviewed-by: serb --- src/share/classes/java/awt/MenuBar.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/share/classes/java/awt/MenuBar.java b/src/share/classes/java/awt/MenuBar.java index 7624b9d37..c94126061 100644 --- a/src/share/classes/java/awt/MenuBar.java +++ b/src/share/classes/java/awt/MenuBar.java @@ -229,9 +229,11 @@ public class MenuBar extends MenuComponent implements MenuContainer, Accessible if (m.peer == null) { m.addNotify(); } + menus.addElement(m); peer.addMenu(m); + } else { + menus.addElement(m); } - menus.addElement(m); return m; } } -- GitLab