Trouble with changing stage icons

Image icon = new Image("duck.png");
stage.getIcons().add(icon);
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
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.
No description
3 Replies
JavaBot
JavaBot2y ago
This post has been reserved for your question.
Hey @zeto! Please use /close or the Close Post button above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
JavaBot
JavaBot2y ago
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived. If your question was not answered yet, feel free to re-open this post or create a new one.

Did you find this page helpful?