Override the method "isCellEditable" and implement as needed, such as:
//instance table model DefaultTableModel tableModel = new DefaultTableModel(){ @Override public boolean isCellEditable(int row, int column) { return false; } }; //...other codes table.setModel(tableModel);