Data modification in JTable ..........

AOAi have JTable filled with certain values.If i double click any cell in JTable then it makes it editable.How can i prevent it from cell editing in any case.regards
[200 byte] By [@tifa] at [2007-11-26 23:51:39]
# 1

// Create a JTable that disallow edits

JTable table1 = new JTable() {

public boolean isCellEditable(int rowIndex, int vColIndex) {

return false;

}

};

// Create a JTable based on the same model as table1 but allows edits

JTable table2 = new JTable(table1.getModel());

// Create a model that disallows edits; JTable's using this model will not allow edits

TableModel model = new DefaultTableModel() {

public boolean isCellEditable(int rowIndex, int mColIndex) {

return false;

}

};

java_2006a at 2007-7-11 15:30:38 > top of Java-index,Java Essentials,Java Programming...