title: BufferedImage to JavaFX image
body: <p>I have an image I screenshot from the primary monitor and I want to add it to a Java FX <code>ImageView</code> as so:</p>
  
  <pre><code>@FXML
  protected ImageView screenshot() throws AWTException, IOException {
      Rectangle screenRect = new Rectangle(Toolkit.getDefaultToolkit().getScreenSize());
      BufferedImage capture = new Robot().createScreenCapture(screenRect);
      ImageView imageView = new ImageView();
      Image image = capture; //Error
      imageView.setImage(image);
      return imageView;
  }
  </code></pre>
  
  <p>I'm trying to set the <code>BufferedImage capture</code> to <code>javafx.scene.image.Image image</code> but the types are incompatible nor am I able to cast it. How can I rectify this?</p>