Issue
I can load image. It doesn't display. What is wrong? I am looking for a solution. I have checked another questions but I have no found a proper way to do it.
public class Main extends Application {
@Override
public void start(Stage stage) throws FileNotFoundException {
Sho.setDefaultSettings();
Pane root = new Pane();
root.getChildren().add(Sho.startPane);
root.getChildren().add(Sho.viewerPane);
Sho.viewPane(Sho.startPane);
//Creating an image
Image image = new Image(new FileInputStream("C:\\img.png"));
//Setting the image view 1
ImageView imageView1 = new ImageView(image);
Solution
You are not adding the imageView to the root Pane's children. You need to do this :
root.getChildren().add(imageView1);
Answered By - Farhan Tariq