Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Drag and Drop To Explorer  RSS feed

 
Bud Fudder
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have an application that shows files in a JTree depicting a directory structure. I'd like to be able to drag and drop files from the app to Windows Explorer, but I can't find anything online to help me. There is plenty on how to drag and drop when the receiver is part of the app, but not for when the receiver is part of the OS.

Does anyone know of any resource that covers dropping to Windows Explorer, rather than to a control in the app?
 
Les Morgan
Rancher
Posts: 768
19
C++ Java MySQL Database Netbeans IDE Oracle Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to OLE automation to do that with Windows, that an OS level interface and as such you'll need to do C/C++ programming using the JNI to gain access to the OLE interface. Unless someone knows of a project that will facilitate that.
 
Bud Fudder
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just want to make sure that I understand your post correctly - are you saying that it is not possible to drag and drop to Windows Explorer from a Java app?
 
Les Morgan
Rancher
Posts: 768
19
C++ Java MySQL Database Netbeans IDE Oracle Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, that is not what I am saying. What I said is you need to interface to the OLE automation layer in Windows, to do that in Java you use the JNI which is a C/C++ level interface. So you have to use the JNI (which you will need to code in C/C++) to build an interface to the OLE layer and use OLE to populate the Windows product.

Bud Fudder wrote:I just want to make sure that I understand your post correctly - are you saying that it is not possible to drag and drop to Windows Explorer from a Java app?
 
Bud Fudder
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Les Morgan wrote:No, that is not what I am saying. What I said is you need to interface to the OLE automation layer in Windows, to do that in Java you use the JNI which is a C/C++ level interface. So you have to use the JNI to build an interface to the OLE layer and use OLE to populate the Windows product.

Ah, thanks. I did misunderstand you - now I think I understand.

Do you know anywhere online I can find some information on how to do this?
 
Les Morgan
Rancher
Posts: 768
19
C++ Java MySQL Database Netbeans IDE Oracle Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can lookup the JNI over at Oracle in one of the tutorials or find one online else where. To find out about OLE automation you will need to look it up at MS support sites.

There maybe a 3rd party class that will do it for you, but I do not know of any off the top of my head.

BTW: have fun ;) I used to be an MS programmer and OLE is a cooperative effort where companies expose proprietary pieces of their product to others to use--It is not always implements fully or well.

Bud Fudder wrote:
Les Morgan wrote:No, that is not what I am saying. What I said is you need to interface to the OLE automation layer in Windows, to do that in Java you use the JNI which is a C/C++ level interface. So you have to use the JNI to build an interface to the OLE layer and use OLE to populate the Windows product.

Ah, thanks. I did misunderstand you - now I think I understand.

Do you know anywhere online I can find some information on how to do this?
 
Brian Cole
Author
Ranch Hand
Posts: 949
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The content at http://archive.oreilly.com/pub/h/4873 or http://books.google.com/books?id=oNbFfcyAtv4C&pg=PA330 may interest you.

update: I don't think directly using OLE or JNI should be required.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!