JFrame: setIconImage(Image image)
import java.awt.Image;
import java.awt.Toolkit;
import javax.swing.JFrame;
/*
*/
public class MainClass {
public static void main(String[] unused) {
JFrame f = new JFrame("FrameIcon");
Image im = Toolkit.getDefaultToolkit().getImage("FrameIcon.gif");
f.setIconImage(im);
f.setSize(100, 100);
f.setLocation(200, 200);
f.setVisible(true);
}
}
Related examples in the same category