Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Drag And Drop from Java Swing Application to Windows Explorer

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.

like image 842
user427843 Avatar asked Aug 22 '10 20:08

user427843


2 Answers

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...

like image 53
Anton Kraievyi Avatar answered Nov 10 '22 01:11

Anton Kraievyi


I guess, all you need can be found here

like image 1
gvsmirnov Avatar answered Nov 10 '22 01:11

gvsmirnov