java - Set JTable not editable -
i want make table uneditable. tried doesn't work :
public mymodel model = new mymodel(); // here declaring model import javax.swing.table.abstracttablemodel; // other class 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 gives me error when using line : says method undefined mymodel class
model.addrow(row);
i did .
public defaulttablemodel model = new mymodel(); public class mymodel extends defaulttablemodel { /** * */ private static final long serialversionuid = 1l; public boolean iscelleditable(int row, int column){ return false; }
Comments
Post a Comment