Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > java.awt.dnd.InvalidDnDOperationException: No drop current

Reply
Thread Tools

java.awt.dnd.InvalidDnDOperationException: No drop current

 
 
Ottfried
Guest
Posts: n/a
 
      04-04-2004
Following situation:
I designed an own component A inherit from JPanel and implementing
DragSourceListener, DropTargetListener and DragGestureListener. Second
I wrote a class, say ATransferable, implementing Transferable. This
class defines a custom DataFlavor as a public static field, AFLAVOR.
The goal is to transfer data by Drag & Drop from one instance of A to
another instance (in a different VM) of A. Until now it is possible do
DnD A into itself (i.e. into the same instance). This works fine. But
trying to DnD it into another instance the exception
"java.awt.dnd.InvalidDnDOperationException: No drop current" appears
for event.getTransferable().getTransferData(AFLAVOR), where event is
of type DropTargetDropEvent. Despite that
event.getTransferable().getTransferDataFlavors() returns AFLAVOR.

Comparing the former and the latter case, I found out, that in the
latter case event.getTransferable() returns a Transferable, where the
contained field (Transferable) local is null.

What goes wrong? Did I forget anything? Have I create my own
TransferHandler? Can anyone explain what steps I've left out to do?

Thanks!

Ottfried
 
Reply With Quote
 
 
 
 
Ottfried
Guest
Posts: n/a
 
      04-09-2004
http://www.velocityreviews.com/forums/(E-Mail Removed) (Ottfried) wrote in message news:<(E-Mail Removed). com>...
> Following situation:
> I designed an own component A inherit from JPanel and implementing
> DragSourceListener, DropTargetListener and DragGestureListener. Second
> I wrote a class, say ATransferable, implementing Transferable. This
> class defines a custom DataFlavor as a public static field, AFLAVOR.
> The goal is to transfer data by Drag & Drop from one instance of A to
> another instance (in a different VM) of A. Until now it is possible do
> DnD A into itself (i.e. into the same instance). This works fine. But
> trying to DnD it into another instance the exception
> "java.awt.dnd.InvalidDnDOperationException: No drop current" appears
> for event.getTransferable().getTransferData(AFLAVOR), where event is
> of type DropTargetDropEvent. Despite that
> event.getTransferable().getTransferDataFlavors() returns AFLAVOR.


There is an easy answer: the drop is available not before
event.acceptDrop(...). This means the drop can't be used to check the
admissibilty of the drop action!
>
> Comparing the former and the latter case, I found out, that in the
> latter case event.getTransferable() returns a Transferable, where the
> contained field (Transferable) local is null.
>
> What goes wrong? Did I forget anything? Have I create my own
> TransferHandler? Can anyone explain what steps I've left out to do?
>
> Thanks!
>
> Ottfried

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
using the current method name within current method Matthew Heidemann Ruby 14 03-22-2011 03:56 AM
printing out the current URL for current ASP page in Perl Jack Perl Misc 3 12-22-2008 02:35 PM
Thread.current.parent and Thread.current.ancestors ara.t.howard@noaa.gov Ruby 3 02-16-2007 03:34 PM
How to update the current web page? (delete current web page + rewrite the page) laryten@yahoo.com Javascript 3 10-12-2006 07:33 PM
How to change the current thread current culture at run time. Manu ASP .Net 1 07-20-2003 03:27 PM



Advertisments