You should use a custom JCheckBox. That JCheckBox can have an ID, on which you can identify it:
public class CustomCheckBox extends JCheckBox {
private final String strID;
public CustomCheckBox(final String strID){
super();
this.strID = strID;
}
public String getID(){
return strID;
}
}
The ID can be whatever you want it - perhaps something defining the row or the content of the row...
Also can you extend the custom component with custom styles, naming (internationalization!) and much more. So the Component is more what you need it to be than what comes with the basic implementation.
insert as seen here in your TableCellEditor:
public Component getTableCellEditorComponent(JTable table, Object value,
boolean isSelected, int row, int column) {
switch (column) {
case 0:
return new CustomCheckBox("Row1");
default: return null;
}
}
regards
Torsten