-
Enhancement
-
Resolution: Won't Fix
-
P4
-
None
-
7
-
generic
-
generic
BasicComboBoxEditor has code in the getItem() method, which allows to edit not only Strings, but with the two conditions:
1. The edited objects must have the public void valueOf(String) method.
2. Developer must call setSelectedItem() for the combo box model BEFORE user types something in a editable combo box.
Such behavior is not documented at all. I suggest:
1. Add public method setEditedObjectClass(Class klass) which will allow to avoid obligatory setSelectedItem() call.
2. Document requirements to the class, objects of which will be edited (a note about the valueOf() method).
Maybe the described behavior will be implemented within the RFE of generalizing Swing.
The 6455449 RFE (Allow user to select non-String items in editable JComboBox, typing their toString() representation) is another way to edit other objects than String.
1. The edited objects must have the public void valueOf(String) method.
2. Developer must call setSelectedItem() for the combo box model BEFORE user types something in a editable combo box.
Such behavior is not documented at all. I suggest:
1. Add public method setEditedObjectClass(Class klass) which will allow to avoid obligatory setSelectedItem() call.
2. Document requirements to the class, objects of which will be edited (a note about the valueOf() method).
Maybe the described behavior will be implemented within the RFE of generalizing Swing.
The 6455449 RFE (Allow user to select non-String items in editable JComboBox, typing their toString() representation) is another way to edit other objects than String.
- relates to
-
JDK-6455449 Allow user to select non-String items in editable JComboBox, typing their toString() representation
-
- Open
-