Hi Kenneth,
I had the same issue, and I spent a lot of time by searching for answer, when I found your post. This led me to solve this problem, and you almost solved it too. The last step should be creating a custom celleditor (extends DefaultCellEditor), and overriding the getTableCellEditorComponent() method, put these into the first two line:
table.setColumnSelectionAllowed(false);
table.setRowSelectionAllowed(true);
The full method:
public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) {
table.setColumnSelectionAllowed(false);
table.setRowSelectionAllowed(true);
return super.getTableCellEditorComponent(table, value, isSelected, row, column);
}
So when you click inside a cell, not the header, the cell editor will set the selection as desired.
I hope you will manage to solve your problem like I did. :)
Best,
Anita