jtable - disable mouse selection
hello,i did like to disable row selection in a jtable by mouse.in fact, the user should not be able to select rows in the table, but programmatily it should work.any ideas?thank yougreetslukas
# 1
You could try removing all the MouseListeners from the table. I don't know what other functionality you would lose.
MouseListener[] listeners = (MouseListener[])table.getListeners(MouseListener.class);
for (int i = 0; i < listeners.length; i++)
table.removeMouseListener( listeners[i] );
# 2
You should extend a class from JTable and override public void changeSelection(int rowIndex, int columnIndex, boolean toggle, boolean extend)