I would like to know how to block the modification of the cells.
I would like to know how to block the modification of the cells.
It can be done by implementing the method boolean isCellEditable(int row, int column)
of DefaultTableModel
.
As you say that what you want is to make some rows editable and others not, you must implement what condition makes them editable / not editable and you return with a true
/ false
. But it's done at cell level . Then you can propagate the value to the rest of the cells to serve the entire row. This way you will know which rows are editable and which ones are not.