![]() |
The Java Developers Almanac 1.4Order this book from Amazon. |
e641. Making a Component a Drop Targetpublic class DropTargetComponent extends JComponent implements DropTargetListener { public DropTargetComponent() { new DropTarget(this, this); } public void dragEnter(DropTargetDragEvent evt) { // Called when the user is dragging and enters this drop target. } public void dragOver(DropTargetDragEvent evt) { // Called when the user is dragging and moves over this drop target. } public void dragExit(DropTargetEvent evt) { // Called when the user is dragging and leaves this drop target. } public void dropActionChanged(DropTargetDragEvent evt) { // Called when the user changes the drag action between copy or move. } public void drop(DropTargetDropEvent evt) { // Called when the user finishes or cancels the drag operation. } }
e642. Handling a Drop Event © 2002 Addison-Wesley. |