jdk/src/share/classes/javax/swing/JComboBox.java
changeset 25110 e1f2746b6439
parent 23715 54ae9dd9df73
child 25144 e2bf17cee34b
--- a/jdk/src/share/classes/javax/swing/JComboBox.java	Mon May 26 16:37:25 2014 +0400
+++ b/jdk/src/share/classes/javax/swing/JComboBox.java	Mon May 26 18:01:59 2014 +0400
@@ -1308,13 +1308,15 @@
      * do not call or override.
      */
     public void actionPerformed(ActionEvent e) {
-        Object newItem = getEditor().getItem();
-        setPopupVisible(false);
-        getModel().setSelectedItem(newItem);
-        String oldCommand = getActionCommand();
-        setActionCommand("comboBoxEdited");
-        fireActionEvent();
-        setActionCommand(oldCommand);
+        ComboBoxEditor editor = getEditor();
+        if ((editor != null) && (e != null) && (editor == e.getSource())) {
+            setPopupVisible(false);
+            getModel().setSelectedItem(editor.getItem());
+            String oldCommand = getActionCommand();
+            setActionCommand("comboBoxEdited");
+            fireActionEvent();
+            setActionCommand(oldCommand);
+        }
     }
 
     /**