Check out example codes for "javafx file to image". It will help you in understanding the concepts better.

Code Example 1

Image image = new Image(new FileInputStream(selectedFile));
  previewPicture.setImage(image);

Code Example 2

Image image = new Image("file:" + path); // "file:src/resource/photo.jpg"

Learn ReactJs, React Native from akashmittal.com