Using Drag and Drop in Java

One of the new features in the Java 2 area of GUI programming is drag and drop. This feature is probably familiar to users of most common windowing systems. For example, in Solaris, you can "drag" a file from one directory to another using multiple File Manager windows. Java 2 provides a similar capability. You can click on a component, and while holding down the mouse, drag it to another application and release the mouse button. You "drop" the component on the application.

Drag and drop is new to Java, and it is limited in terms of what it will support. In fact, the default implementation in Java 2 only supports text. You can write your own code to do more if you wish. The interfaces and classes for the Java 2 drag ...

Get PURE Java™ 2 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.