How To: Customize The Icon
In A Java Windows Application

The icon appears in the upper left corner of the window -- its default appearance is that of a coffee cup. To change it to any other GIF or JPG, include this statement:

f.setIconImage(Toolkit.getDefaultToolkit().getImage(getClass().getResource("logo.gif")));

In the above statement, f is the JFrame object, and logo.gif is the icon's image file, which must be stored in the same folder as the .java file. The file can be of any size, but 32x32 pixels is best. When deploying in a jar, be sure to include the image file as well as the .class file.