Examples Index
Drag and drop, and cut, copy and paste (collectively called data transfer) are essential features of most applications. But what kind of support does Swing provide and how do you take advantage of it?
This section has been updated to reflect features and conventions of the latest release, JDK 6.0, but it is not yet final. We've published this preliminary version so you can get the most current information now, and so you can tell us (please!) about errors, omissions, or improvements we can make to this tutorial.
For many components, when performing a drag and drop or a cut and paste operation, Swing handles all of the work for you. For a handful of components, most of the work is done for you and all that is left for you is to plug in the details of the data import and export.
This lesson provides an introduction to the data transfer mechanism used by Swing and discusses, in particular, the
TransferHandlerclass, the workhorse of the data transfer system.