views:

172

answers:

2

Hi, I have question about Drag And Drop in Java. I was able to to implement drag and drop files from Windows Explorer to Swing application. Now I need to oposite direction. I have JTable which contains Column with object type File. I just need to detect which file (files) are dragged and where in Windows Explorer.

Thanks in advance.

A: 

I guess, all you need can be found here

gvsmirnov
Thanks for link. I will take look...
That link is to a post made in 1999 for Java 1.2; doubt it is still relevant.
Gweebz
I'd be interested if there is another way to do DnD, as I'm working on a project right now that is using `java.awt.dnd` as the link suggests.
unholysampler
This is generic advice, slightly better than 'did you look at the log files'.
ddimitrov
+1  A: 

I was working with java<->native DnD couple of years ago and my findings were something like below.

If you need to know to which folder dragged files were dropped (for example) to write them out from database: I am quite unsure this is possible. The best you could do is precreating files on drag start, passing correct file references to drop target app, and hoping that explorer default drop handler does what you need. I suspect that on drag-out of java app you have no control and no callbacks on the drop target application (until you have own fancy super-hook somewhere on the explorer side).

Not sure your scenario is as bad as mine was; the feature was not critical and we deferred it...

Anton S. Kraievoy