Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8120094

JFXPanel: Drag and Drop of custom data formats doesn't work.

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Not an Issue
    • Affects Version/s: 7u13, 8
    • Fix Version/s: None
    • Component/s: javafx
    • Environment:

      Windows 7, Java(TM) SE Runtime Environment (build 1.7.0_13-b20), JavaFx 2.2.5

      Description

      I tried to add a drag and drop capable javafx control to a swing internal frame.
      As long as I use a simple String everythig is fine but unfortuately the drag and drop does not work as I try to use my own custom data format (which is serializeable!!)

      The following stackstrace is shown:

      onDragDetected
      Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: failed to parse:MyDragAndDropData
      at java.awt.datatransfer.DataFlavor.<init>(DataFlavor.java:428)
      at javafx.embed.swing.SwingDnD$DnDTransferable.getTransferDataFlavors(SwingDnD.java:458)
      at sun.awt.datatransfer.DataTransferer.getFormatsForTransferable(DataTransferer.java:654)
      at sun.awt.dnd.SunDragSourceContextPeer.startDrag(SunDragSourceContextPeer.java:129)
      at java.awt.dnd.DragSource.startDrag(DragSource.java:321)
      at java.awt.dnd.DragSource.startDrag(DragSource.java:426)
      at java.awt.dnd.DragGestureEvent.startDrag(DragGestureEvent.java:237)
      at javafx.embed.swing.SwingDnD.startDrag(SwingDnD.java:309)
      at javafx.embed.swing.SwingDnD.access$1300(SwingDnD.java:71)
      at javafx.embed.swing.SwingDnD$4$1.run(SwingDnD.java:261)
      at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
      at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:727)
      at java.awt.EventQueue.access$200(EventQueue.java:103)
      at java.awt.EventQueue$3.run(EventQueue.java:688)
      at java.awt.EventQueue$3.run(EventQueue.java:686)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
      at java.awt.EventQueue.dispatchEvent(EventQueue.java:697)
      at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
      at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
      at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
      at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
      Exception in runnable
      java.lang.IllegalArgumentException: Key already associated with a running event loop: java.lang.Object@3b7f4e
      at com.sun.javafx.tk.quantum.QuantumToolkit.enterNestedEventLoop(QuantumToolkit.java:514)
      at com.sun.javafx.tk.quantum.FxEventLoop$Impl.start(FxEventLoop.java:49)
      at com.sun.javafx.tk.quantum.FxEventLoop.enterNestedLoop(FxEventLoop.java:96)
      at com.sun.javafx.tk.quantum.EmbeddedSceneDnD$ClipboardAssistanceImpl.flush(EmbeddedSceneDnD.java:167)
      at com.sun.javafx.tk.quantum.QuantumClipboard.flush(QuantumClipboard.java:197)
      at com.sun.javafx.tk.quantum.QuantumToolkit.startDrag(QuantumToolkit.java:1195)
      at javafx.scene.Scene$DnDGesture.dragDetectedProcessed(Scene.java:2652)
      at javafx.scene.Scene$DnDGesture.process(Scene.java:2713)
      at javafx.scene.Scene$DnDGesture.access$8700(Scene.java:2607)
      at javafx.scene.Scene$MouseHandler.process(Scene.java:3344)
      at javafx.scene.Scene$MouseHandler.process(Scene.java:3168)
      at javafx.scene.Scene$MouseHandler.access$1900(Scene.java:3123)
      at javafx.scene.Scene.impl_processMouseEvent(Scene.java:1563)
      at javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2265)
      at com.sun.javafx.tk.quantum.EmbeddedScene$2$1.run(EmbeddedScene.java:194)
      at com.sun.javafx.tk.quantum.EmbeddedScene$2$1.run(EmbeddedScene.java:176)
      at java.security.AccessController.doPrivileged(Native Method)
      at com.sun.javafx.tk.quantum.EmbeddedScene$2.run(EmbeddedScene.java:176)
      at com.sun.javafx.application.PlatformImpl$4$1.run(PlatformImpl.java:179)
      at com.sun.javafx.application.PlatformImpl$4$1.run(PlatformImpl.java:176)
      at java.security.AccessController.doPrivileged(Native Method)
      at com.sun.javafx.application.PlatformImpl$4.run(PlatformImpl.java:176)
      at com.sun.glass.ui.win.WinApplication._enterNestedEventLoop(Native Method)
      at com.sun.glass.ui.Application.enterNestedEventLoop(Application.java:383)
      at com.sun.glass.ui.EventLoop.enter(EventLoop.java:83)
      at com.sun.javafx.tk.quantum.QuantumToolkit.enterNestedEventLoop(QuantumToolkit.java:520)
      at com.sun.javafx.tk.quantum.FxEventLoop$Impl.start(FxEventLoop.java:49)
      at com.sun.javafx.tk.quantum.FxEventLoop.enterNestedLoop(FxEventLoop.java:96)
      at com.sun.javafx.tk.quantum.EmbeddedSceneDnD$ClipboardAssistanceImpl.flush(EmbeddedSceneDnD.java:167)
      at com.sun.javafx.tk.quantum.QuantumClipboard.flush(QuantumClipboard.java:197)
      at com.sun.javafx.tk.quantum.QuantumToolkit.startDrag(QuantumToolkit.java:1195)
      at javafx.scene.Scene$DnDGesture.dragDetectedProcessed(Scene.java:2652)
      at javafx.scene.Scene$DnDGesture.process(Scene.java:2713)
      at javafx.scene.Scene$DnDGesture.access$8700(Scene.java:2607)
      at javafx.scene.Scene$MouseHandler.process(Scene.java:3344)
      at javafx.scene.Scene$MouseHandler.process(Scene.java:3168)
      at javafx.scene.Scene$MouseHandler.access$1900(Scene.java:3123)
      at javafx.scene.Scene.impl_processMouseEvent(Scene.java:1563)
      at javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2265)
      at com.sun.javafx.tk.quantum.EmbeddedScene$2$1.run(EmbeddedScene.java:194)
      at com.sun.javafx.tk.quantum.EmbeddedScene$2$1.run(EmbeddedScene.java:176)
      at java.security.AccessController.doPrivileged(Native Method) at com.sun.glass.ui.win.WinApplication.access$100(WinApplication.java:29)
      at com.sun.glass.ui.win.WinApplication$3$1.run(WinApplication.java:73)
      at java.lang.Thread.run(Thread.java:722)
      at com.sun.javafx.tk.quantum.EmbeddedScene$2.run(EmbeddedScene.java:176)
      at com.sun.javafx.application.PlatformImpl$4$1.run(PlatformImpl.java:179)
      at com.sun.javafx.application.PlatformImpl$4$1.run(PlatformImpl.java:176)
      at java.security.AccessController.doPrivileged(Native Method)
      at com.sun.javafx.application.PlatformImpl$4.run(PlatformImpl.java:176)
      at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)


      When the control is used inside a standalone javafx application, the "drag and drop" works as expected.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                art Artem Ananiev
                Reporter:
                duke J. Duke (Inactive)
              • Votes:
                1 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported: