java.awt.dnd.InvalidDnDOperationException: No drop current

Discussion in 'Java' started by Ottfried, Apr 4, 2004.

  1. Ottfried

    Ottfried Guest

    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
     
    Ottfried, Apr 4, 2004
    #1
    1. Advertising

  2. Ottfried

    Ottfried Guest

    (Ottfried) wrote in message news:<>...
    > 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
     
    Ottfried, Apr 9, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Robert Mark Bram
    Replies:
    2
    Views:
    6,037
    Robert Mark Bram
    Dec 11, 2003
  2. Tomer
    Replies:
    2
    Views:
    486
    Tomer
    Feb 9, 2005
  3. Timo Nentwig

    Java Swing DnD and Konqueror

    Timo Nentwig, Dec 24, 2004, in forum: Java
    Replies:
    0
    Views:
    343
    Timo Nentwig
    Dec 24, 2004
  4. shackman
    Replies:
    0
    Views:
    2,101
    shackman
    Aug 16, 2006
  5. Prakash
    Replies:
    1
    Views:
    297
    GArlington
    Feb 26, 2008
Loading...

Share This Page