I want to change JDialog icon.
Code below works for *.jpg files, but doesn’t work for *.ico files (also refer to my previous question JDialog – how to change icon)
ImageIcon img = new ImageIcon(Wizard.class.getResource("Picture.jpg"));
wizardDialog.setIconImage(img.getImage());
Of course I can convert my *.ico file to *.jpg file, but then I will loose transparency.
I want to keep transparency (icon without transparency is very ugly). Is it possible?
This could be a problem with the .ico format. I have never tried to use .ico but rather relied on .png which supports alphatransparency very well. Maybe converting your .ico file to .png will do the trick for you.