I wrote this code:
public void start(Stage stage) throws Exception {
Group root = new Group();
Scene scene = new Scene(root);
Image icon = new Image("file:/home/ernestosmr/Documents/java_projects/helloFX/src/java.png", 64,64,true,true);
stage.getIcons().add(icon);
stage.setTitle("Stage demo program wooot");
stage.setScene(scene);
stage.show();
}
I have my java.png
on my src
folder but still is not showing on my stage when I run this code. I try different things but it's not working. I'm using IntelliJ IDEA.
I want the icon appears on my stage when I run the code.