I have table (JXTable) which has columns of type: String, Date and some custom objects.
So I created TableModel for table and set table cell editors by calling:
myTable.setDefaultEditor(MyCustomClass.class, new DefaultCellEditor(new JComboBox(new MyCustomClassComboBoxModel())));
myTable.setDefaultEditor(Date.class, new JDateChooserCellEditor());
I recently noticed that if I want to edit some String column I can normally double click on it and it would go to editing mode, but I can not go to editing mode if I first double click on columns of type: Date or MyCustomClass.
So when I open frame that contains table if I want to edit some Date or MyCustomClass columns I have to click on some String column first to go to editing mode, and then everything works OK (I can edit Date and MyCustomClass columns).
But if I first double click on Date or MyCustomClass columns nothing happens (it does not go to editing mode).
JDateChooserCellEditor I didn't create. I'm simply using com.toedter.calendar.JDateChooserCellEditor.
And for my custom class cell editor I used DefaultCellEditor and put my ComboBoxModel for that custom class, as I mentioned:
I also noticed that Boolean type cells which cell editors I didn't even set (JXTable sets it by default), also have this problem of not getting to editing mode unless some String type cell first is double clicked?!?
Can you show us the implementation for those methods?
JTable uses isCellEditable to determine whether or not a cell can be edited. It uses getColumnClass to help determine the renderer / editor for a column. Boolean and the numeric types have built-in renderers / editors, that's why you saw a check box for the boolean class.