Image icon = new Image("duck.png");
stage.getIcons().add(icon);
That's what Im doing to change the icon of the stage but I'm getting this error:
Caused by: java.lang.IllegalArgumentException: Invalid URL or resource not found
at javafx.graphics/javafx.scene.image.Image.validateUrl(Image.java:1123)
... 8 more
Exception running application main.NewFXMain
Not sure what I'm doing wrong with the url.