how to set a particular column as editable false

Hi frenz .. i need to make a particular column in to set editable false in jtable how to do this.by vinod.
[120 byte] By [brainvinod@yahoo.co.ina] at [2007-11-27 9:13:08]
# 1

you can do that by using method

public boolean isCellEditable(int row,int col)

e.g.

DefaultTableModel dtModel=new DefaultTableModel(dataValues, columnNames);

table = new JTable(dtModel)

{

public boolean isCellEditable(int row,int col)

{

if(row<data_row_cnt)

{

if(col==7 || col==8 || col==17 || col==18 || col==21)

return true;

}

return false;

}

};

if you want ti disabled cell no 2,3 means 2nd row ,3rd column

then just chk row==2 && col=3 return false otherwise return true>

sagar_biraria at 2007-7-12 22:00:16 > top of Java-index,Desktop,Core GUI APIs...