I want to make function updating current item in JComboBox:
@Override
public void updateId(String id) {
boolean old = notify;
notify = false;
comboBox.setEditable(true);
comboBox.setSelectedItem(id);
comboBox.setEditable(false);
notify = old;
}
The result is this:

- ComboBox is bound to textbox,
- I change textbox value, which is calling updateId(),
- Expanding combobox,
- Selecting item that got changed,
The combo’s drop down list does not reflect the change made to selected item; in the given example, there should be “xxx” at the bottom of drop down list.
I misinterpreted
JComboBox.setSelectedItem().It sounds like it should override item being under selected index of model when combobox is editable, but it just overrides displayed value and doesn’t touch model.
This one does the job: