How to convert a File to Image for display in ImageView in java?
I am attempting to display an image file as soon as it is selected from a file chooser. The file chooser is restricted to .png and .jpg files with the selected files being stored in a variable of type File. To do this I have set up an ImageView, and I wish to set the image with this new file only problem is it is of type File not Image. How can this be achieved? Code so far... public void fileSelection(){ FileChooser fileChooser = new FileChooser(); fileChooser.setTitle("Select Profile Picture"); fileChooser.getExtensionFilters().addAll(new FileChooser.ExtensionFilter("Image Files", "*.png", "