Skip to content

Commit e334896

Browse files
committed
JMenu addNotify too early
1 parent 29164c3 commit e334896

File tree

1 file changed

+3
-2
lines changed
  • sources/net.sf.j2s.java.core/src/javax/swing

1 file changed

+3
-2
lines changed

sources/net.sf.j2s.java.core/src/javax/swing/JMenu.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,9 @@ public void setPopupMenuVisible(boolean b) {
337337
// System.out.println("in JMenu.setPopupMenuVisible " + b);
338338
// // Thread.dumpStack();
339339
// }
340-
//
340+
341+
if (b && popupMenu.getPeer() == null)
342+
popupMenu.addNotify();// BH SwingJS
341343
boolean isVisible = isPopupMenuVisible();
342344
if (b != isVisible && (isEnabled() || !b)) {
343345
ensurePopupMenuCreated();
@@ -544,7 +546,6 @@ private void ensurePopupMenuCreated() {
544546
this.popupMenu = new JPopupMenu();
545547
popupMenu.setInvoker(this);
546548
popupListener = createWinListener(popupMenu);
547-
popupMenu.addNotify();// BH SwingJS
548549
}
549550
}
550551

0 commit comments

Comments
 (0)