Clipboard Problem - HeapByteBuffer

Pavel Safrata pavel.safrata at oracle.com
Wed Jul 10 23:58:23 PDT 2013


Hello Ryan,
which FX version are you using?
Thanks,
Pavel

On 10.7.2013 18:00, Ryan Cuprak wrote:
> Hello,
>   I have a question - I have been running into a problem with the clipboard (randomly) where I get a java.nio.HeapByteBuffer instead of the object that I am expecting. I am trying to implement copy/paste within a TableView.
>
> // Define the custom format
> private static final DataFormat columnDescriptorFormat = new DataFormat("ColumnDescriptor");
>   
> // Copy the data (invoked from a context menu) - object being placed into the clipboard implements Externalizable
> ClipboardContent content = new ClipboardContent();
> content.put(columnDescriptorFormat,cd);
>
> // Paste logic - second line often fail
> Clipboard clipboard = Clipboard.getSystemClipboard();
> Object obj = clipboard.getContent(columnDescriptorFormat) // Often an instance of HeapByteBuffer instead of a column descriptor
>
>   Any idea under what circumstances a HeapByteBuffer would be returned instead?
>
> -Ryan
>   
>
>
>   



More information about the openjfx-dev mailing list