Hi I need to disable an entire JTable i.e disallow the user to select any row, column or cell. Is there anyway of doing this? Thanks in advance, Sumitra
Hi Paul, Thanks for your reply, but that's not quite what I wanted. I have a ListSelectionListener attached to the JTable, that keeps track of changes in row selection and displays the selected row's details in some textfields. For a particular circumstance, I don't want these details to be displayed in the textfields and hence want the JTable to be disabled so that the user cannot perform row selections. I tried out what you had suggested, but it still triggers the row changed event and displays the selected row in the textfields. If you/anyone has knows some way of doing this, please do write. Thanks in advance, Sumitra
Check for the particular circumstance and clear the selection of the table(which deselects selected columns and rows)using Table.clearSelection(); else try to manipulate with Table.getSelectionModel().setSelectionInterval(index,index);
Hi Sumitra, there are three default editors associated with the class types. If you remove these associations, the JTable will become read-only. You can still select the cells /cols / rows as per your settings. The code for disabling is: