Skip to content
Advertisement

How can I make a checkbox on JTable not editable after a checkbox is clicked?

I have created a JTable with 4 columns, the last two columns are JCheckBoxes. I would like to disable the checkbox in column three after I clicked the checkbox on column two and vice versa.

JavaScript

This is what I’ve done so far but both column 2 and 3 are editable. Please help. Thank you.

Advertisement

Answer

but both column 2 and 3 are editable.

Well, that is what your isCellEditable(...) method states.

If you don’t want column 3 to be editable then you need to modify your code. Maybe something like:

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement