Drag and Drop - Swing Compatibility

Pavel Safrata pavel.safrata at oracle.com
Tue Mar 26 11:39:37 PDT 2013

Hello Scott,
this is it, isn't it?

On 26.3.2013 18:28, Scott Palmer wrote:
> I'm porting my mixed Swing/JavaFX app to full JavaFX.  One thing I can do in the application is drag an object from a JTree and drop it into my Scene.
> Swing allows me to have an arbitrary Java Object as the data in the Transferrable.  When dropped this shows up in a DragBoard with MIME type "application/x-java-serialized-object" with the object instance as the data.  The drop proceeds fine.
> Here's the catch.  The data object is NOT serializable.  When I try to create the equivalent DragBoard from the JavaFX side it throws an exception saying as much as soon as I call setContent on the DragBoard.
> How did Swing manage to create the DragBoard? Can I do the same?
> Scott

More information about the openjfx-dev mailing list