Then Comes Drag and Drop

The Drag and Drop API is located in the java.awt.dnd package and consists of 4 interfaces and 15 classes. When you first encounter java.awt.dnd, you'll probably feel overwhelmed. After all, there's a lot of infrastructure to Drag and Drop. However, after you've learned the basics, this feeling will dissipate.

Drag and Drop uses the concepts of drag sources and drop targets. A drag source is an object associated with a component that serves as the source of a drag-and-drop operation. In contrast, a drop target is an object associated with a component that serves as the target of a drag-and-drop operation. So what gets dragged (and subsequently dropped)? It turns out that Drag and Drop uses transferables to encapsulate ...

Get Special Edition Using Java 2 Standard Edition 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.