Java Swing Tutorial - Java ImageIcon.getImageObserver()








Syntax

ImageIcon.getImageObserver() has the following syntax.

public ImageObserver getImageObserver()

Example

In the following code shows how to use ImageIcon.getImageObserver() method.

import javax.swing.ImageIcon;
//  w  ww  .jav  a2  s .  c  o  m
public class Main {
  public static void main(String[] argv) throws Exception {

    ImageIcon icon = new ImageIcon("image.gif");
    icon.setDescription("Description of Image");
    
    System.out.println(icon.getImageObserver());
  }
}