Suppose one wants to let an Applet user to enter a new item in a JComboBox
and the permission is given whenever the blank item (which is one existing
item in the JComboBox designed by the programmer) is selected. However,
when one selects the blank item, the cursor does not blink at the beginning
of the blank (similar to a JTextField, the cursor is not at the left end). So if the
user does not left-shift the cursor, after entering an item, for example "cat",
the item appears as "cat", and NOT "cat " as desired. So the key is
to set the cursor at the beginning so that users do not need to left-shift the
cursor (save users some work) to get the desired "cat".
add a selection listener, and in there:
[code]
if("".equals(cb.getSelectedItem())) {
ComboBoxEditor editor = cb.getEditor();
cb.configureEditor(editor, "");
cb.setSelectedItem(editor.getItem());
}
[code]
Maybe... although, I believe if you select any item on an editable checkbox, the value is selected and focused.
Actually, sounds like your blank item is " " and not ""