title: Copy image from JavaFX application and paste it using Windows
body: <p>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.</p>
  <pre><code> File file = new File(&quot;C:\\Users\\Admin\\Desktop\\my\\mysql.gif&quot;);
      Image image = new Image(file.toURI().toString());
      ImageView ive =new ImageView(image);
      cm = new ContextMenu();
   MenuItem copy = new MenuItem(&quot;Copy&quot;);
   cm.getItems().add(copy);
   copy.setOnAction(new EventHandler&lt;ActionEvent&gt;() {
  
          @Override
          public void handle(ActionEvent t) {
              //Paste Image at location
              Clipboard clipboard = Clipboard.getSystemClipboard();
              ClipboardContent content = new ClipboardContent();
              content.putImage(image); // the image you want, as javafx.scene.image.Image
              clipboard.setContent(content);
          }
      });
  </code></pre>
  <p>For example, like shown below in images.</p>
  <p><img src="https://i.stack.imgur.com/qNm0p.png" alt="Copy Image From aaplication" /></p>
  <p>And want to paste at location from using of Windows features menu.</p>
  <p><img src="https://i.stack.imgur.com/652br.png" alt="Paste Image at spectific location" /></p>