Skip to content
Advertisement

Copy image from JavaFX application and paste it using Windows

I am working on a JavaFX application. I want to copy image from application using context menu and paste it using Windows feature of paste.

JavaScript

For example, like shown below in images.

Copy Image From aaplication

And want to paste at location from using of Windows features menu.

Paste Image at spectific location

Advertisement

Answer

Use the Clipboard and ClipboardContent, e.g. as:

JavaScript

For the “Paste” operation of Windows context menus to work, the clipboard content has to be File. In the case demonstrated above, this is easy, otherwise a temporary file should be created.

Advertisement