How to make a JTable non-editable? I don’t want my users to be able to edit the values in cells by double-clicking them.
How to make a JTable non-editable? I don’t want my users to be able
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can use a
TableModel.Define a class like this:
actually
isCellEditable()isfalseby default so you may omit it. (see: http://docs.oracle.com/javase/6/docs/api/javax/swing/table/AbstractTableModel.html)Then use the
setModel()method of yourJTable.