Forums Register Login

DND out of an application?

+Pie Number of slices to send: Send
For the most part I've figured out DND with trees and other thing within a GUI but now I'd like to DND out of the application and say. Say I have a JTree representing directories on the file system. I'd like to be able to drag from my GUI onto the desktop and have windows copy the file to the desktop. Any ideas? Everytime I try it I get the "no drop" icon when I hover over the desktop.
+Pie Number of slices to send: Send
As shown in $1.5docs/guide/dragndrop/spec/dnd1.html#2.5.3 this

works okay (single files only) for copy_and_paste and for drag_n_drop from a JTree to the win xp desktop.
To test it I used a (plain) JTree with FileStore class nodes, a TransferHandler for the tree and a Transferable class like the one in TreeDrag from this thread DND from JTree to JTable. And copied the createMenuBar method from the DragPictureDemo2 app in the Adding Cut/Copy/Paste Support section of the DnD tutorial.
Do not meddle in the affairs of dragons - for you are crunchy and good with ketchup. Crunchy tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1167 times.
Similar Threads
Drag-and-drop questions in the exam.
Latest practice in GUI development
Integrating Selenium and FEST
Drag and Drop files from local files sytem to applet.
Drag from a JList to the desktop
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 02:32:22.