DragNDrop from Java to Windows Explorer

I want to create a Java application that displays a directory and adds drag and drop support for copying files from that directory to an open explorer window and vice versa (Windows system).

Adding drag and drop support from Windows Explorer to a java application is pretty simple, it somehow eludes me how to do it when the activity starts from the Java application and ends in explorer.

I tried google and SO search but to no avail.

Any pointers, directions, snippets of codes or pseudo codes will be appreciated.

So, is it possible to drag and drop from a Java application and transfer data to the target folder in the native application? If so (should be) can you point me in the right direction?

+2


source to share


3 answers


Yes, you need to set the mime type to portable and set the accepted actions (like copy, move, etc.) as well as the default action (this is similar to the copy action for what you are trying to do). This class is a hyphenation handler that is used to handle DnD in Swing.



+1


source


Just use fileListFlavour DataFlavour and File drag'n drop will work both ways.



I'm sure you found the section on drag n drop in the java tutorial.

+1


source


Book: Swing Hacks Hack # 65 This is your answer :)

0


source







All Articles