The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
October 2001



This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.



Posted by Matt Gerrans on October 26, 2001 at 11:51 PM

Okay, I feel pretty sheepish about that silly socket comment, especially now that I looked a little at java.awt.dnd (at first I thought you were referring to Dungeons and Dragons, or something). I was just trying to drive home the statement that I hadn't done drag and drop with Java, but do I know you shouldn't hose the clipboard in the process. There is a more in-depth article on the subject at JavaWorld:

- mfg

> While I feel reading from/writing to local host is a nice idea, its like reinventing the wheel. We have an excellent framework in dnd.* and datatransfer.* Extending those classes builds a good piece of software.

> In my opinion, extending DataFlavor to include a field (imageFlavor) and using DragSource.startDrag() which takes an image as a parameter should solve the problem.

> or simply, drag the path of the image and let the target container take care of loading the image.

> Anyways, Avin, let us know how you finished it (or if you need more ideas)!

> -Jay.


Sponsored Links

Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us