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

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

jquery - javascript onscroll fade same class but with different div -