In JDK1.1, this is fixed. You have to use a GIF file (not ICO file!). The GIF dimension should be 16x16. With 1.5, you can use a PNG or JPG file.
You set the icon with :
frame.setIconImage(Toolkit.getDefaultToolkit().getImage("myIcon.gif"));
frame.setIconImage
(Toolkit.getDefaultToolkit()
.getImage(getClass().
getResource("images/myIcon.gif")));
frame.setIconImage(
new ImageIcon(
YourApp.class.getResource("logo.png")
).getImage()
);
Written and compiled by Réal Gagnon ©1998-2012
[ home ]