Java ImageIcon.getDescription()

Syntax

ImageIcon.getDescription() has the following syntax.

public String getDescription()

Example

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


//from   ww w.ja v a2  s  .co  m
import javax.swing.ImageIcon;

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.getDescription());
  }
}