java - JavaFX 2 Window Icon not working -
i'm trying add icon javafx 2 application, ways have found don't seem work.
image icon = new image(getclass().getresourceasstream("/images/icon.png")); stage.geticons().add(icon);
the icon 32x32 in size.
when try
image icon = new image("http://goo.gl/kyeql");
it work, in netbeans , in runnable jar.
i hope can fixed.
the problem in icon itself. did load should, reason didn't display should.
i remade icon trying use different sizes (16x16 512x512) , added them icon list.
stage.geticons().add(new image(getclass().getresourceasstream("/images/logo_16.png"))); stage.geticons().add(new image(getclass().getresourceasstream("/images/logo_32.png"))); stage.geticons().add(new image(getclass().getresourceasstream("/images/logo_64.png"))); stage.geticons().add(new image(getclass().getresourceasstream("/images/logo_128.png"))); stage.geticons().add(new image(getclass().getresourceasstream("/images/logo_256.png"))); stage.geticons().add(new image(getclass().getresourceasstream("/images/logo_512.png")));
now uses icon should.
Comments
Post a Comment