Unable to change icon image for JFrame
Im not sure why but Im attempting to change an icon image for a JFrame (the one in the top left corner) but its not working at all. Im using the following code:
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import java.awt.Dimension;
import java.awt.Image;
import java.awt.Toolkit;
publicclass TestUpperIcon{
publicstaticvoid main(String []args){
JFrame frame =new JFrame("Test");
frame.setPreferredSize(new Dimension(200, 200));
frame.pack();
Image img = Toolkit.getDefaultToolkit().getImage("proem-icon1.gif");
frame.setIconImage(img);
frame.setVisible(true);
}
}
Unfortunately just the default icon is displayed.
Any help please?

