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

Data Transfer

The DropTargetListener's drop method is responsible for the data transfer. There are three parts to the drop method:

  • Checks validity of the dropped action and DataFlavor; the drop is rejected, if necessary.

  • Accepts the drop with a specified action and the Transferable's data object is retrieved.

  • Reads and uses the data.

Drop Method Part 1: Validation

The DropTargetListener chooses the DataFlavor and checks the operation before the transfer takes place. The DropTargetListener sends a rejectDrop message to the DropTargetDropEvent if none of the DataFlavors and/or operations is acceptable. The Event object may be queried with isLocalTransfer if the drag source is in the same JVM. If this is so, the DropTargetListener can choose an appropriate ...

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