I'm trying to add an Icon to my JavaFX 2 application, but the ways I have found don't seem to work.
Image icon = new Image(getClass().getResourceAsStream("/images/icon.png"));
stage.getIcons().add(icon);
The icon is 32x32 in size.
When I try
Image icon = new Image("http://goo.gl/kYEQl");
It does work, in Netbeans and in the runnable jar.
I hope this can be fixed.