Example usage for java.awt Frame setIconImage

List of usage examples for java.awt Frame setIconImage

Introduction

In this page you can find the example usage for java.awt Frame setIconImage.

Prototype

public void setIconImage(Image image) 

Source Link

Usage

From source file:FrameIcon.java

/** Demo main program, showing two ways to use it.
 * Create a small MemImage and set it as this Frame's iconImage. 
 * Also display a larger version of the same image in the Frame.
 *//*from  ww w . j  a  v a 2 s  .  c  om*/
public static void main(String[] av) {
    Frame f = new Frame("FrameIcon");
    Image im = Toolkit.getDefaultToolkit().getImage("java2s.gif");
    f.setIconImage(im);
    f.setSize(100, 100);
    f.setLocation(200, 200);
    f.setVisible(true);
}

From source file:MemImage.java

/**
 * Demo main program, showing two ways to use it. Create a small MemImage
 * and set it as this Frame's iconImage. Also display a larger version of
 * the same image in the Frame.//  w  w w  .  j  a va 2  s  . c o m
 */
public static void main(String[] av) {
    Frame f = new Frame("MemImage.java");
    f.add(new MemImage());
    f.setIconImage(new MemImage(16, 16).getImage());
    f.pack();
    f.setVisible(true);
}