JTable Non-Editable Cells

JTable cells are by default editable cells but some scenarios we need non-editable JTable.
Below code helps you to make non-editable JTable cells.
JTable table = new JTable(defaulttablemodel) {
@Override
public boolean isCellEditable(int rowIndex, int colIndex) {
return false; // Disallow the editing of any cell
}
};

Related Posts:
How to Add JButton As JTable ColumnHeader

Related posts:

  1. How to add JButton in JTable ColumnHeader

Comments are closed.