I will just introduce some details into JTable. and save this data in my database with a specific identifier. But if I get this data in id-based JTable, then JTable should not allow the operation to be edited at this time. it is just for the purpose. How to set whether Jtable is allowed or not based on user choice. (Insert, Search)
Variability is controlled primarily by the method isCellEditable TableModel.
isCellEditable
TableModel
You can set a parameter in yours TableModelthat can return falseif you want the model to be read-only.
false
TableModel.isCellEditable(int rowIndex, int columnIndex).
TableModel isCellEditable(), , .
isCellEditable()
. JTable.isCellEditable(int row, int column), isCellEditable().