Disable user edit in JTable [duplicate]

You can create a JTable using following code:

    JTable jTable = new JTable() {
        private static final long serialVersionUID = 1L;

        public boolean isCellEditable(int row, int column) {                
                return false;               
        };
    };

Basically what we are doing here is overriding isCellEditable and always returning false from it. This will make a non editabe JTabel.

Leave a Comment