Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

java.awt.dnd.InvalidDnDOperationException : Drag and drop in progress

843806Jul 24 2009 — edited Aug 5 2009
Hi,

I'm using the Drag and Drop feature, and everything works fine most of the time except sometimes a java.awt.dnd.InvalidDnDOperationException is raised with the following message : Drag and drop in progress.

In the method drop(DropTargetDropEvent dtde) I use
dtde.acceptDrop(dtde.getDropAction());
dtde.dropComplete(true);
According to what i undertood, the dropComplete method will notify the drag source that the drop has been performed and the
public void dragDropEnd(DragSourceDropEvent dsde)
method of the drag source is executed.

My problem is that sometimes the drop is performed but the dragDropEnd method is not called and then the next time i try to dragNDrop an object the Exception is raised.
I don't understand when exactly it happens, and even when I catch the exception I don't success in "reseting" the drag and drop context.

Is there any way to avoid the exception or to reset the drag and drop context ?

Thanks for your help,

barjovial
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 2 2009
Added on Jul 24 2009
7 comments
1,211 views