Name: gm110360 Date: 09/10/2004
FULL PRODUCT VERSION :
1.5.0-rc-b63
A DESCRIPTION OF THE PROBLEM :
When tabbing out of an editable JComboBox to another control its popup-list will remain visible. Changing focus by clicking on a different control via mouse will hide popup.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Open a combobox's popup list. Switch to the textfield using the tabulator key => Popup remains visible
Switch back (Shift+Tab). Switch to the textfield using a mouse click => Popup is hidden
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
See above. Popup should be hidden when tabbing out.
ACTUAL -
Popup remains open.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
public class ComboTest {
public static void main(String[] args) {
JFrame frame = new JFrame();
frame.getContentPane().setLayout(new java.awt.FlowLayout());
JComboBox comboBox = new JComboBox(new Object[] {"A", "B"});
comboBox.setEditable(true);
frame.getContentPane().add(comboBox);
frame.getContentPane().add(new JTextField("I wan't more focus!"));
frame.pack(); frame.setVisible(true);
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
hidePopupOnFocusLoss=System.getProperty("java.version").startsWith("1.5");
comboBox.getEditor().getEditorComponent().addFocusListener(new FocusAdapter() {
public void focusLost(FocusEvent e) {
if (hidePopupOnFocusLoss) comboBox.setPopupVisible(false);
}
});
Release Regression From : 1.4.2
The above release value was the last known release where this
bug was known to work. Since then there has been a regression.
(Incident Review ID: 302409)
======================================================================
###@###.### 11/2/04 18:07 GMT