问题描述:

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.

网友答案:

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;
}
相关阅读:
Top