Disable user edit in JTable
When a JTable component is created, cell editing is enabled by default. How can I prevent the user from editing the content of a JTable? A JTable uses an AbstractTableModel object. This is the thing you pass into the constructor of the JTable. You can write your own AbstractTableModel as follows public class MyTableModel extends AbstractTableModel { public boolean isCellEditable(int row, int column){ return false; } } and then initialize your JTable as JTable myTable = new JTable(new MyTableModel()); Rahul Borkar You can create a JTable using following code: JTable jTable = new JTable() {