Not Recommended Documentclose button

Important: The information in this document is Not Recommended and should not be used for new development.

Current information on this Reference Library topic can be found here:

Version: 1.0

Posted: 2003-01-14

Build Requirements: N/A

Runtime Requirements: Mac OS X

View Source Code:

Download Sample (“”, 24.1K)
Download Sample (“JDragNDrop.dmg”, 83.6K)


This project demonstrates building a simple view to implement drag and drop functionality in Cocoa-Java. CLASSES: < > sublcassed from NSView. MyView creates a simple view and overrides the necessary init methods. The most important parts of MyView are registering for specific drag types and the concludeDragOperation method. All of the methods must be there for the drag and drop to work correctly, due to messaging of Cocoa. POSSIBLE ENHANCEMENTS: Modify constructor to allow different drag types and modify concludeDragOperation to operate on the different types.

Document Revision History

Date Notes
2003-01-14Demonstrates building a simple view to implement Drag-and-Drop functionality in Cocoa-Java.

Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.