jdk/src/share/classes/javax/swing/MenuSelectionManager.java
changeset 23298 1c729daf92a0
parent 22584 eed64ee05369
child 25201 4adc75e0c4e5
--- a/jdk/src/share/classes/javax/swing/MenuSelectionManager.java	Mon Feb 17 13:41:50 2014 +0400
+++ b/jdk/src/share/classes/javax/swing/MenuSelectionManager.java	Mon Feb 17 17:15:28 2014 +0400
@@ -30,6 +30,7 @@
 import javax.swing.event.*;
 
 import sun.awt.AppContext;
+import sun.swing.SwingUtilities2;
 
 /**
  * A MenuSelectionManager owns the selection in menu hierarchy.
@@ -60,6 +61,12 @@
             if (msm == null) {
                 msm = new MenuSelectionManager();
                 context.put(MENU_SELECTION_MANAGER_KEY, msm);
+
+                // installing additional listener if found in the AppContext
+                Object o = context.get(SwingUtilities2.MENU_SELECTION_MANAGER_LISTENER_KEY);
+                if (o != null && o instanceof ChangeListener) {
+                    msm.addChangeListener((ChangeListener) o);
+                }
             }
 
             return msm;