i am having difficulties in making my table cells uneditable. I don't know how. The data from my table came from my database in MySQL. Please help me make my table cells uneditable because I don't want users to edit the data displayed in each cell. Thank you!
Asked
Active
Viewed 65 times
-1
-
1see http://stackoverflow.com/questions/8372799/making-jtable-cells-uneditable http://stackoverflow.com/questions/1990817/how-to-make-a-jtable-non-editable http://stackoverflow.com/questions/18795791/how-to-make-individual-cell-of-a-jtable-uneditable http://stackoverflow.com/questions/24726896/how-to-make-cells-of-jtable-non-editable-but-selectable – Emerson Cod Oct 20 '15 at 11:06
1 Answers
0
Hi just use in your JTable model
public boolean isCellEditable(int row, int col)
{ return false; }

edasssus
- 331
- 4
- 15
-
-
-
Look over [here](https://docs.oracle.com/javase/tutorial/uiswing/components/table.html) its oracles table tutorial/documentation and you should have in your project class which extends `AbstractTableModel` and in that class you can override method `isCellEditable(int row, int col)`. – edasssus Oct 20 '15 at 11:34