Skip to main content

Drag and Drop question

2 replies [Last post]
milenman
Offline
Joined: 2010-08-09

Hello,

I am implementing a drag and drop functionality. The user should be able to drag a node from the tree ( which represents tree with servers and cameras) and drop it in a ImagePanel(extends JPanel). The ImagePanel should show an image from the camera.
I implemented a TreeTransferHandler, set it as a TransferHandler to my tree and in importData i handle the showing of the image in ImagePanel. Then in the main GUI class i set the ImagePanel as a dropTarget and i am not sure whether this is right. And if it is, i have to implement a DropTargetListener() and its method drop() and i am wondering why do i have to do this, when it is already specified in dataImport?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
milenman
Offline
Joined: 2010-08-09

this tutorial: http://www.straub.as/java/clip-dnd/dnd.html helped me a lot, it's a pity that i coulndt find it earlier

milenman
Offline
Joined: 2010-08-09

alle unklarheiten haben sich erledigt nach noch 1 Tag lesen und probieren :)