I created a MasterDetail Simple Form
using Netbeans
, and I have a JTable
which is related to the database.
I want to edit a column in this JTable
to make it non-editable.
I Googled about it and this all I can find :
this.masterTable.getColumn("Validation").setEditable(false);
which won't work with me !
Override the isCellEditable(...)
method of the TableModel.
DefaultTableModel model = new DefaultTableModel(...)
{
@Override
public boolean isCellEditable(int row, int column)
{
// add your code here
}
}
JTable table = new JTable( model );