JTable DnD on unselected row

I want to have a JTable that I can drag from, starting the drag from an unselected row in a table that has multiple selection enabled. This only has to work on JDK/JRE 1.6.0

Having looked at the docs then at the BasicTableUI I see that I can't do it because the BasicTableUI is preventing drags fromunselected rows in multiple selection tables and using the drag to extend the selection instead.

I could fix the problem with a small change to the UI code except that almost everything I want to change is either private or uses private data/methods. So to make what would otherwise have been a simple derivation and override of a small method I'll have to copy chunks of Suns UI code until I have enough of the private routines so I can change the couple of lines I need to.

Is there any way of doing this thatdoesn't involve fiddling with Suns code with all the license and maintenance implications that would bring.

[962 byte] By [Crooka] at [2007-11-27 7:01:10]
# 1

It is possible when you implement your own DragGestureListener and DragSourceListener.

But this is not a simple task, you'll have to decide in the dragGestureRecognized(DragGestureEvent event) method of your GestureListener which operation is a drag operation and which one shall result in the multiselection. Otherwise you'll turn off the multiselection by always invoking the drag operation.

marco@dea at 2007-7-12 18:52:00 > top of Java-index,Desktop,Core GUI APIs...
# 2
I'll take a look. I'm not interested in retaining multi-row selection through dnd.
Crooka at 2007-7-12 18:52:00 > top of Java-index,Desktop,Core GUI APIs...