diff --git a/src/share/classes/java/awt/MenuBar.java b/src/share/classes/java/awt/MenuBar.java index 7624b9d370cd68cc007a50252ab3eed4744d0f17..c941260615c35aed6f292aa07b8206a806ca879f 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; } }