I want to change the JDialog icon (replace the standard java cup) I can do this as follows:
ImageIcon img = new ImageIcon(OuterClass.class.getResource("fileThatWorks.jpg"));
myJDialog.setIconImage(img.getImage());
Howerver, when I replaced the fileThatWorks.jpgcode image.ico, stopped working. I tried to convert mine image.icoto image.jpg, but it was not pasted.
What is wrong with my approach? Why does it work for some * jpg files, but it does not work for * ico files?
source
share