JComboBox keeps focus after mouse select...

I have an application that consists of a JTable, with both text and numerical editors and column sorting. The value parameters in the table are edited using an Integer Editor and the text values are selected using a ComboBox. The problem I have is that after I click a selection on the ComboBox, the focus remains on the ComboBox and if I don't physically change the focus of the box (click another editor) before I sort the column, I get undefined selection results in the box. I am looking for a way to stopCellEditing() and remove the focus from the edited comboBox automatically after a mouse click selection. Thanks, guys.

[635 byte] By [ramcsua] at [2007-10-3 10:20:22]
# 1
I think using a DefaultCellEditor is the simplest way to do this.for exampleDefaultCellEditor editor = new DefaultCellEditor(myComboBox);myTable.setDefaultEditor(String.class, editor);
mpmarronea at 2007-7-15 5:41:43 > top of Java-index,Desktop,Core GUI APIs...
# 2

I inherit from DefaultCellEditor and create my own ComboBoxEditor, so it should function as a DefaultCellEditor would. Maybe another example of its erratic actions will help... It seems that sometimes, I will change the value of one combo box and the value of another will change accordingly (to the same value I set in the first combobox). The setSelectedItem() methods are never called for that second one, but the text value is changed, so the next time you click on the faulty box the change is saved. This same thing happens if after changing the first combo box I highlight multiple rows of the JTable. One or two other random boxes along that column will change. I am never telling them to change their values!?

ramcsua at 2007-7-15 5:41:43 > top of Java-index,Desktop,Core GUI APIs...
# 3
"I inherit from DefaultCellEditor and create my own ComboBoxEditor, so it should function as a DefaultCellEditor would. "I am pretty sure that is not correct.The other problem sounds like an issue with your cell renderer, not the editor. You could post your code.
mpmarronea at 2007-7-15 5:41:43 > top of Java-index,Desktop,Core GUI APIs...
# 4
I'm definitely no expert at this, as you can tell so thank you. Your input is very helpful. How do I access the cell renderer and what are some things I should look out for that I might be doing wrong?
ramcsua at 2007-7-15 5:41:43 > top of Java-index,Desktop,Core GUI APIs...