Reputation: 562
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?
Upvotes: 4
Views: 1061
Reputation: 6803
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.
Upvotes: 2