views:

83

answers:

1

I am just wondering if it's possible to I cancel "Drag and Drop" operation in Java/Swing programmatically? So the effect would be similar to if the user pressed the "ESC" key?

I was expecting DragSourceDragEvent or DragSourceContext to have a cancelDrag() method, similar to DropTargetDragEvent which has acceptDrag() and rejectDrag() methods (both of which does not do what I want).

I am missing something?

+1  A: 

Confirmed I tried several ways of doing this and nothing worked I also tried using the Robot class to press escape :)

Appears it is not currently possible to abort this with the current API.

krystan honour