Reputation: 13
The JTable
should allow only a particular, selected row to be edited. The rest of the table should be in the non-editable mode. Upon clicking a an "Edit" button, it should ideally just take into consideration the row number and make it editable.
Upvotes: 0
Views: 595
Reputation: 205875
Override isCellEditable()
in your table's TableModel
and return true
for the desired row:
private static final int DESIRED_ROW = …;
@Override
public boolean isCellEditable(int row, int column) {
return row == DESIRED_ROW;
}
Upvotes: 2