Skip to main content

Misteriously JTable is not "dragging"

No replies
Joined: 2003-06-10

Hi. I have built a demo application to enable drag from a table to (drop) into a list. I mean, JTable and JList, of course. I am working with java 5

In my demo app everything works, I have also implemented some Transferable and TransferHandler to let the two JComponent transfer a custom application object instead of some raw data like some string as default.
Anyway, the simplest thing is:


This line is enough to enable the drag. If the target component is prepared, it will receive a standard Transferable with the table selected row content in some different flavors.

Now, I have a case in which I call setDragEnabled(true) on a table and the drag does not activate. I do not know why but I think that something ntercepts the drag gesture. The createTransferable is never called on the TransferHandler binded to my table instance.

Do you have experience ono something that can broken the built in dnd support for JTable? Some custom data renderer, maybe? Anything else?

Note that the drag does not work even if I set up a DragSource and create a default Drag Gesture and set up all the stuff.

Any idea?