4
votes

I've implemented drag and drop in my JTree, but I'm wondering is there a way to show the item(s) being dragged while dragging (such as when dragging in Windows Explorer or dragging files in Eclipse for example)?

1
I only see the cursor when I'm dragging. It will show the no-drop symbol if it cannot be dropped, but I'd like to show the actual object I'm dragging.Jeff Storey
no idea, you have to create Dragable JToolTip, JWindow, JPanel and there copy content of node during dragmKorbel

1 Answers

5
votes

The trick is to add an additional layer (JPanel) over your app to render the images as they drag. Romain Guy wrote a slick and easy example of this a few years ago:

http://www.jroller.com/gfx/entry/drag_with_style_in_swing