This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin for Android App Development and have Peter Sommerhoff on-line!
See this thread for details.
Win a copy of Kotlin for Android App Development this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Devaka Cooray
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

InvalidDnDOperationException: Drag and drop in progress  RSS feed

 
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I have an applet there I use drag and drop to a grid in a Jpanel. The objects I DnD is for example a JLabel, JButton!

This run without any problem on Win2000 and Internet Explorer! But if I run the same on WinXP I'll get java.awt.dnd.InvalidDnDOperationException: Drag and drop in progress!
I'm using jre1.4. Have tried with later version but had problems with the DnD to function.

Does anyone have a clue to what is the problem?

best regards, Emil Karlsson
[ November 05, 2005: Message edited by: Emil Karlsson ]
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey!

I had a problem with these InvalidDnDExceptions too. Not in an applet, but in an application on Win32. I didn't find neither the reason why nor the excact action producing that action. It just sometimes happened. Afterwards, DnD stopped working.
My ugly workaround is to put a try-catch-block around the startDrag-call.
Now, it seems to work fine. Might work for you...
 
k Oensen
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Uhmm... and make sure, that you didn't use setDragEnabled(true);
Probably this causes a double-drag.
 
Emil Karlsson
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, thanks a lot
I'll try the try/catch thing.
The setDragEnabled(true) have read about in some other forums and have checked for.

I also found today that in some cases it can be a good idea to not mix the DnD from AWT and Swing. I've not tried it yet, so I don't know if it is that cause my problem!

Thanks again

Emil Karlsson
 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by k Oensen:
Uhmm... and make sure, that you didn't use setDragEnabled(true);
Probably this causes a double-drag.



This is the right solution, thanks
 
The moth suit and wings road is much more exciting than taxes. Or this tiny ad:
Programmatically Create PDF Using Free Spire.PDF with Java
https://coderanch.com/wiki/703735/Programmatically-Create-PDF-Free-Spire
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!