I want to make my table uneditable. I tried this but it doesn't work :
public MyModel model = new MyModel(); // Here i am declaring my model
import javax.swing.table.AbstractTableModel; // the other class for the model
public class MyModel extends AbstractTableModel {
public boolean isCellEditable(){
return false;
}
@Override
public int getColumnCount() {
// TODO Auto-generated method stub
return 0;
}
@Override
public int getRowCount() {
// TODO Auto-generated method stub
return 0;
}
@Override
public Object getValueAt(int rowIndex, int columnIndex) {
// TODO Auto-generated method stub
return null;
}
}
But it gives me error when i am using this line : it says that the method is undefined for MyModel class
model.addRow(row);