This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

DnD MOVE within Local VM  RSS feed

 
Daniel Puryear
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
Want to rearrange a container hiearchy using DnD (Yes, I know it does not have to be DnD.) Have set-up the usual sample DropSource and DropTarget using some of the code from Core SWING Advanced Programming
By Kim Topley. Have Eclipse watching both sides of the transfer. What I'm seeing on a MOVE that surprised me for the LocalProxy is that the DropTarget.getTransferData(targetFlavor) is returning an unparented "deepCopy" of the referenced object passed in the ComponentTransferable.getTransferData(DataFlavor fl).

Its easy to see that would be the case transferring out of a VM to the peer layers but just did'nt think it was to be the case within a local application.

Is this the expected behavior of the DnD LocalProxy MOVE??
 
Daniel Puryear
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Whoooops! Seems you need to signal the peer plumbing what you really want to do; use something like:

DataFlavor objectflavor = new DataFlavor(DataFlavor.javaJVMLocalObjectMimeType);
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!