I have JTable of order 7X145 which are cell editable through check boxes.
I would like to setEditable(false) only for coloumn(0) since it only contains the name of the respective rows.
How can I achieve this without disturbing the other column’s editable property because whenever i click column(0), it throws an error stating…
Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Boolean
Your problem is that you have a table model that is implementing
getColumnClass()in such a way that is says the first column is a Boolean instead of String. Fix that and you will no longer have that error and will be able to also edit the name.If you truly don’t want any editing on the first column, override the
isCellEditable() to return false for that column.