Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

DnD from Swing to Windows?  RSS feed

 
Johann Dobbins
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have an FTP style app. I implemented the ability to drag files from the ftp window to the desktop. The code looks something like:



The problem is that when I drag to the desktop, the getTransferData() method gets called before I release the mouse button. It is called on the drag. Ideally, I would expect the drag to just call the isDataFlavorSupported, and then when the user releases the mouse button, the getTransferData method would be called and the files would be downloaded. Otherwise, the app appears very unresponsive when it pauses to download files just because they were dragged over the destkop.

I'm hoping that someone is familiar with this situation and can propose a workaround. Thank you.
 
Stanislav Lapitsky
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why can't you return something (a custom object) which won't download data immediately but has kind of reference to the files and downoad them after drop?

Regards,
Stas
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!