Drag and Drop - Swing Compatibility

Scott Palmer swpalmer at gmail.com
Tue Mar 26 12:00:31 PDT 2013

Yes.  That's it.  The thing is that the SwingDnD support for JavaFX is bridging the gap somehow already.  Is it doing something evil?


On 2013-03-26, at 2:39 PM, Pavel Safrata <pavel.safrata at oracle.com> wrote:

> Hello Scott,
> this is it, isn't it?
> https://javafx-jira.kenai.com/browse/RT-29082
> Thanks,
> Pavel
> 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