diff options
Diffstat (limited to 'javax/swing/JPopupMenu.java')
-rw-r--r-- | javax/swing/JPopupMenu.java | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/javax/swing/JPopupMenu.java b/javax/swing/JPopupMenu.java index c7890ea0e..2e59d4767 100644 --- a/javax/swing/JPopupMenu.java +++ b/javax/swing/JPopupMenu.java @@ -120,7 +120,7 @@ public class JPopupMenu extends JComponent implements Accessible, MenuElement private boolean lightWeightPopupEnabled; /** SelectionModel that keeps track of menu selection. */ - private SingleSelectionModel selectionModel; + protected SingleSelectionModel selectionModel; /* Popup that is used to display JPopupMenu */ private transient Popup popup; @@ -820,7 +820,14 @@ public class JPopupMenu extends JComponent implements Accessible, MenuElement */ public void menuSelectionChanged(boolean changed) { - if (! changed) + if (invoker instanceof JMenu) + { + // We need to special case this since the JMenu calculates the + // position etc of the popup. + JMenu menu = (JMenu) invoker; + menu.setPopupMenuVisible(changed); + } + else if (! changed) setVisible(false); } |