-
Bug
-
Resolution: Not an Issue
-
P5
-
None
-
5.0
-
x86
-
windows_xp
FULL PRODUCT VERSION :
JDK 1.5.0_04 b05
ADDITIONAL OS VERSION INFORMATION :
Windows XP
A DESCRIPTION OF THE PROBLEM :
When JComboBox loses focus its actionPerformed method is called per this stack trace:
at com.lickersoft.soap.DictumCreatorFinder.setCurrentWidget(DictumCreatorFinder.java:222)
at com.lickersoft.soap.DictumCreatorFinder.actionPerformed(DictumCreatorFinder.java:359)
at javax.swing.JComboBox.fireActionEvent(Unknown Source)
at javax.swing.JComboBox.actionPerformed(Unknown Source)
at javax.swing.plaf.basic.BasicComboBoxUI$Handler.focusLost(Unknown Source)
at java.awt.AWTEventMulticaster.focusLost(Unknown Source)
at java.awt.AWTEventMulticaster.focusLost(Unknown Source)
at java.awt.Component.processFocusEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.KeyboardFocusManager.redispatchEvent(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
This always fires "comboBoxEdited". The combo box was not edited. It just lost focus.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
I'm not sure you need steps to reporduce this. The actionPerformed method of JCombobox always fires an action event of this type and, apparently BasicComboBoxUIHandler calls actionPerformed:
public void focusLost( FocusEvent e ) {
if (e.getSource() == comboBox.getEditor().getEditorComponent()) {
ComboBoxEditor editor = comboBox.getEditor();
Object item = editor.getItem();
if (!e.isTemporary() && item != null &&
!item.equals( comboBox.getSelectedItem())) {
comboBox.actionPerformed
(new ActionEvent(editor, 0, "",
EventQueue.getMostRecentEventTime(), 0));
}
return;
}
hasFocus = false;
// GES, 980818:
// Note that the second check here is a workaround to bug
// 4168483. There is a bogus focusLost sent to the
// ComboBox with isTemporary false when a mediumweight menu
// is popped up. Until this is fixed in AWT, we make the
// tradeoff of not popping down mediumweight popups when
// the combobox loses focus. Although this means that the
// combobox does not remove such menus when you tab out,
// it is seen as more desirable than the alternative which
// is that mediumweight combobox menus dissappear immediately
// on popup, rendering them completely unusable.
if ( !e.isTemporary() && comboBox.isLightWeightPopupEnabled()) {
setPopupVisible(comboBox, false);
}
comboBox.repaint();
}
So, as I read it, if the combobox editor loses focus, not temporarily, then the combobox will end up generating an actionEvent indicating the combobox was edited, which isn't necessarily the case.
This makes "comboBoxEdited" useless.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
When the editor loses focus if anything the actionCommand of the event JComboBox sends to actionListerers should be something like "focusLost".
ACTUAL -
When the BAsicComboBoxEditor loses focus JCOmbox fires an actionEvent with actionCommand="comboBoxEdited"
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
I pasted the relevant source code into the description. There is no code to
reproduce.
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
None. Developers cannot count on the action commands from JComboBox
JDK 1.5.0_04 b05
ADDITIONAL OS VERSION INFORMATION :
Windows XP
A DESCRIPTION OF THE PROBLEM :
When JComboBox loses focus its actionPerformed method is called per this stack trace:
at com.lickersoft.soap.DictumCreatorFinder.setCurrentWidget(DictumCreatorFinder.java:222)
at com.lickersoft.soap.DictumCreatorFinder.actionPerformed(DictumCreatorFinder.java:359)
at javax.swing.JComboBox.fireActionEvent(Unknown Source)
at javax.swing.JComboBox.actionPerformed(Unknown Source)
at javax.swing.plaf.basic.BasicComboBoxUI$Handler.focusLost(Unknown Source)
at java.awt.AWTEventMulticaster.focusLost(Unknown Source)
at java.awt.AWTEventMulticaster.focusLost(Unknown Source)
at java.awt.Component.processFocusEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.KeyboardFocusManager.redispatchEvent(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
This always fires "comboBoxEdited". The combo box was not edited. It just lost focus.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
I'm not sure you need steps to reporduce this. The actionPerformed method of JCombobox always fires an action event of this type and, apparently BasicComboBoxUIHandler calls actionPerformed:
public void focusLost( FocusEvent e ) {
if (e.getSource() == comboBox.getEditor().getEditorComponent()) {
ComboBoxEditor editor = comboBox.getEditor();
Object item = editor.getItem();
if (!e.isTemporary() && item != null &&
!item.equals( comboBox.getSelectedItem())) {
comboBox.actionPerformed
(new ActionEvent(editor, 0, "",
EventQueue.getMostRecentEventTime(), 0));
}
return;
}
hasFocus = false;
// GES, 980818:
// Note that the second check here is a workaround to bug
// 4168483. There is a bogus focusLost sent to the
// ComboBox with isTemporary false when a mediumweight menu
// is popped up. Until this is fixed in AWT, we make the
// tradeoff of not popping down mediumweight popups when
// the combobox loses focus. Although this means that the
// combobox does not remove such menus when you tab out,
// it is seen as more desirable than the alternative which
// is that mediumweight combobox menus dissappear immediately
// on popup, rendering them completely unusable.
if ( !e.isTemporary() && comboBox.isLightWeightPopupEnabled()) {
setPopupVisible(comboBox, false);
}
comboBox.repaint();
}
So, as I read it, if the combobox editor loses focus, not temporarily, then the combobox will end up generating an actionEvent indicating the combobox was edited, which isn't necessarily the case.
This makes "comboBoxEdited" useless.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
When the editor loses focus if anything the actionCommand of the event JComboBox sends to actionListerers should be something like "focusLost".
ACTUAL -
When the BAsicComboBoxEditor loses focus JCOmbox fires an actionEvent with actionCommand="comboBoxEdited"
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
I pasted the relevant source code into the description. There is no code to
reproduce.
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
None. Developers cannot count on the action commands from JComboBox