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 ...

Get JavaBeans Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.