How to disable or enable JTable cell selection?
Disables or enables
JTable's cell selection can be done by calling the
setCellSelectionEnabled(boolean cellSelectionEnabled) method. This method accept a
boolean value. Calling this method also changes the state of table's row and column selection repectively.
To completely remove the selection capability from
JTable component we can change its focusable state to
false by calling the
setFocusable(boolean focusable) method.