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
[241 byte] By [lukas.mysliveca] at [2007-11-26 18:35:18]
# 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] );

camickra at 2007-7-9 6:09:23 > top of Java-index,Desktop,Core GUI APIs...
# 2
You should extend a class from JTable and override public void changeSelection(int rowIndex, int columnIndex, boolean toggle, boolean extend)
Meenakshi_Unnia at 2007-7-9 6:09:23 > top of Java-index,Desktop,Core GUI APIs...