JTable row drag and drop and multiple selection

Given: JTable with multiple selection enabled.

Problem: we made it possible to drag rows to other positions. When dragging a row to another row, all rows in between will be selected, we do not want this.

Question: Is there an easy way to turn this off, without losing the possibility for multiple selection using shift and control?

Details:

Long time ago my colleague implemented the possibility to drag single rows of a JTable to a different location by setting

setDragEnabled(false)

and using the mousePressed and mouseReleased methods of a MouseListener on the table.

This works fine for us.

Multiple selection is turned on in the table, which we use by pressing shift and control.

[793 byte] By [Strider80a] at [2007-11-27 2:29:42]
# 1
Read the [url http://java.sun.com/docs/books/tutorial/uiswing/dnd/intro.html#complex]Drag and Drop[/url] tutorial. The extend DnD section has a working example.
camickra at 2007-7-12 2:42:58 > top of Java-index,Desktop,Core GUI APIs...
# 2
Thank you, that looks promising.It may not be the exact solution I was asking for, but it is probably even better because you can rearrange not only single rows but whole selections.
Strider80a at 2007-7-12 2:42:58 > top of Java-index,Desktop,Core GUI APIs...