in

My Image is not rendering despite no errors JavaFx


I’ve searched the stackoverflow but no solutions are working for my code.

The image for some reason isn’t rendering. There is no Icon for the Stage

I tried this: JavaFX Image not showing in stage but the image still wouldn’t render.
Code:

package com.example.javafxfirst;

import javafx.application.Application;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.image.Image;
import javafx.stage.Stage;
import javafx.scene.paint.Color;

import java.io.File;

public class HelloApplication extends Application {

    public static void main(String[] args) {
        launch(args);
    }

    @Override
    public void start(Stage stage) throws Exception {

        //Stage stage = new Stage();
        Group root = new Group();
        Scene scene = new Scene(root,Color.BLACK);

        Image icon = new Image(new File("resources/javafxlogo.png").toURI().toString());
        stage.getIcons().add(icon);
        stage.setTitle("Program");
        stage.setScene(scene);
        stage.show();
    }
}

Project Structure

[![enter image description here][2]][2]


  [1]: https://stackoverflow.com/questions/24260019/javafx-image-not-showing-in-stage/47042512
  [2]: https://i.stack.imgur.com/Qyd8H.png



Source: https://stackoverflow.com/questions/70716708/my-image-is-not-rendering-despite-no-errors-javafx

Adding and substracting in C++

Google Earth Based Geoscience Video Library Built With React.js