How do I disable and entire row in a JTable? Thanks, Ike
Tor Iver Wilhelmsen - 01 Nov 2003 01:36 GMT
> How do I disable and entire row in a JTable? Thanks, Ike
How disable? In order to not being able to edit, return false from
isCellEditable() for the row. To make it render "disabled", check in a
custom renderer for some custom flag you create in the model.
kk - 02 Nov 2003 21:27 GMT
You have to create a table with a custom Table model.
In the TableModel class:
public class xTableModel extends AbstractTableModel{
.....code.....
public boolean isCellEditable(int row, int col) {
........code....
if (row==x) return false; //now you can't edit the cells in row x
}
}
I hope to have been of some assistance
Greetz
Kristof
> How do I disable and entire row in a JTable? Thanks, Ike