Image problem...
I was tring this code to change frame's icon but it didnt work. And I tried the same thing to assign an image to my tray icon too:
window.setIconImage(Toolkit.getDefaultToolkit().getImage("image.png"));
But it doesnt work. Nothing happens with this code. I have tried to write the name of image's path and name, only name (image was in .../src/images/ directory). I was sure that I have written the path and the name correctly. I am using Ubuntu.
Thanks for any help...
Try putting the image in another location, say root "/image.png" and then try the with this path. The code you posted looks okay, another option is to use a debugger with a breakpoint placed before your image loads.
Try the this code too:
window.setIconImage(new ImageIcon(getClass().getResource("image.png").getImage());
Path u have specified implies that the java or .class file u are working on is in the same folder as the image.png. if not, then please specify the path properly.
Let us know what happens next.