-
Bug
-
Resolution: Won't Fix
-
P3
-
None
-
6
-
generic
-
generic
A DESCRIPTION OF THE REGRESSION :
When instantiating a JComboBox with setEditable(true) and setFocusable(false) there is no way for the user to enter their own values in the combo box, they are limited exclusively to the pre-supplied choices.
The JComboBox does not own the focus when being edited, but the getEditorComponent() from ComboBoxEditor does, so the JComoboBox is the anscestor.
REPRODUCIBLE TESTCASE OR STEPS TO REPRODUCE:
import java.awt.FlowLayout;
import java.awt.GridLayout;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
public class JEditableComboBoxRegression {
public static void main(String[] args) {
JFrame f = new JFrame();
f.setLayout(new GridLayout(0, 2));
JComboBox cb;
f.add(new JLabel("Plain:"));
cb = new JComboBox(new Object[] {"Alpha", "Beta", "Gama"});
f.add(cb);
f.add(new JLabel("NonFocusable:"));
cb = new JComboBox(new Object[] {"Foo", "Bar", "Baz"});
cb.setFocusable(false);
f.add(cb);
f.add(new JLabel("Editable:"));
cb = new JComboBox(new Object[] {"Left", "Right", "Center"});
cb.setEditable(true);
f.add(cb);
f.add(new JLabel("Editable, then NonFocusable:"));
cb = new JComboBox(new Object[] {"One", "Two", "Thr33"});
cb.setEditable(true);
cb.setFocusable(false);
f.add(cb);
f.add(new JLabel("NonFocusable, then Editable:"));
cb = new JComboBox(new Object[] {"Four", "5ive", "Six"});
cb.setFocusable(false);
cb.setEditable(true);
f.add(cb);
f.pack();
f.setVisible(true);
}
}
RELEASE LAST WORKED:
5.0 Update 6
RELEASE TEST FAILS:
mustang-b70
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
I was expecting, when the user clicks directly in the editable portion of the JComboBox, that the combo box goes into edit mode.
This is only from a mouse click, not using the focus traversal keys. In both 5.0 and 6.0 you cannot tab into any of the non-focusable fields.
ACTUAL -
I could change the editable combo box, but for the bottom two ("Editable, then NonFocusable:", and "NonFocusable, then Editable:") I could not force the combobox to go into editor mode.
APPLICATION NAME: Intelliden R-Series APPLICATION VERSION: 4.4
OBSERVED APPLICATION IMPACT:
Our application depends on such a combobox in the toolbar to allow for user selectable refresh values while that combo box is not available via Tab traversal. Defaults are fine but you will get the occasional wacko who demans that the refresh time be set at 4.2 seconds.
When instantiating a JComboBox with setEditable(true) and setFocusable(false) there is no way for the user to enter their own values in the combo box, they are limited exclusively to the pre-supplied choices.
The JComboBox does not own the focus when being edited, but the getEditorComponent() from ComboBoxEditor does, so the JComoboBox is the anscestor.
REPRODUCIBLE TESTCASE OR STEPS TO REPRODUCE:
import java.awt.FlowLayout;
import java.awt.GridLayout;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
public class JEditableComboBoxRegression {
public static void main(String[] args) {
JFrame f = new JFrame();
f.setLayout(new GridLayout(0, 2));
JComboBox cb;
f.add(new JLabel("Plain:"));
cb = new JComboBox(new Object[] {"Alpha", "Beta", "Gama"});
f.add(cb);
f.add(new JLabel("NonFocusable:"));
cb = new JComboBox(new Object[] {"Foo", "Bar", "Baz"});
cb.setFocusable(false);
f.add(cb);
f.add(new JLabel("Editable:"));
cb = new JComboBox(new Object[] {"Left", "Right", "Center"});
cb.setEditable(true);
f.add(cb);
f.add(new JLabel("Editable, then NonFocusable:"));
cb = new JComboBox(new Object[] {"One", "Two", "Thr33"});
cb.setEditable(true);
cb.setFocusable(false);
f.add(cb);
f.add(new JLabel("NonFocusable, then Editable:"));
cb = new JComboBox(new Object[] {"Four", "5ive", "Six"});
cb.setFocusable(false);
cb.setEditable(true);
f.add(cb);
f.pack();
f.setVisible(true);
}
}
RELEASE LAST WORKED:
5.0 Update 6
RELEASE TEST FAILS:
mustang-b70
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
I was expecting, when the user clicks directly in the editable portion of the JComboBox, that the combo box goes into edit mode.
This is only from a mouse click, not using the focus traversal keys. In both 5.0 and 6.0 you cannot tab into any of the non-focusable fields.
ACTUAL -
I could change the editable combo box, but for the bottom two ("Editable, then NonFocusable:", and "NonFocusable, then Editable:") I could not force the combobox to go into editor mode.
APPLICATION NAME: Intelliden R-Series APPLICATION VERSION: 4.4
OBSERVED APPLICATION IMPACT:
Our application depends on such a combobox in the toolbar to allow for user selectable refresh values while that combo box is not available via Tab traversal. Defaults are fine but you will get the occasional wacko who demans that the refresh time be set at 4.2 seconds.
- relates to
-
JDK-6184449 JComboBox responds to Key Events even when it is non-focusable
-
- Closed
-