< prev index next >
src/share/classes/javax/swing/JComboBox.java
Print this page
rev 14331 : 8072767: DefaultCellEditor for comboBox creates ActionEvent with wrong source object
Reviewed-by: serb, azvegint
@@ -566,10 +566,12 @@
}
}
if (!found) {
return;
}
+
+ getEditor().setItem(anObject);
}
// Must toggle the state of this flag since this method
// call may result in ListDataEvents being fired.
selectingItem = true;
@@ -1305,21 +1307,17 @@
/**
* This method is public as an implementation side effect.
* do not call or override.
*/
public void actionPerformed(ActionEvent e) {
- ComboBoxEditor editor = getEditor();
- if ((editor != null) && (e != null) && (editor == e.getSource()
- || editor.getEditorComponent() == e.getSource())) {
setPopupVisible(false);
- getModel().setSelectedItem(editor.getItem());
+ getModel().setSelectedItem(getEditor().getItem());
String oldCommand = getActionCommand();
setActionCommand("comboBoxEdited");
fireActionEvent();
setActionCommand(oldCommand);
}
- }
/**
* This method is public as an implementation side effect.
* do not call or override.
*/
< prev index next >