O'Reilly logo

JavaBeans Unleashed by Rick Leinecker, Dr. Donald Doherty

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

DataFlavors and Actions

Data is made available to DropTarget in a variety of DataFlavors through the Transferable object. Transferable provides an object reference for a local transfer within the same Java Virtual Machine (JVM).

This wouldn't make sense for transfers to another JVM or to the native system, so a DataFlavor using java.io.InputStream subclass is usually provided.

When implementing drag-and-drop operations, you may request various drag-and-drop actions. The DnDConstants class defines the class variables for the supported actions.

  • ACTION_NONE No action taken.

  • ACTION_COPY The DragSource leaves the data intact.

  • ACTION_MOVE The DragSource deletes the data upon successful completion of the drop.

  • ACTION_COPY or ACTION_MOVE The DragSource ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required