API Overview API Index Package Overview Direct link to this page
JDK 1.6
  javax.swing. ImageIcon View Source
Author(s)
Jeff Dinkins
Lynn Monsanto
Since
Version
1.55 04/07/06
Serial
Hierarchy
 Object
      ImageIcon
Implements
 Icon
 Serializable
 Accessible
Subclasses
Description
public class ImageIcon
  An implementation of the Icon interface that paints Icons from Images.
See also:   
Constructors
public ImageIcon ()
Creates an uninitialized image icon.
public ImageIcon (byte[] imageData)
  Creates an ImageIcon from an array of bytes which were read from an image file containing a supported image format, such as GIF, JPEG, or (as of 1.3) PNG.
public ImageIcon (byte[] imageData, String description)
  Creates an ImageIcon from an array of bytes which were read from an image file containing a supported image format, such as GIF, JPEG, or (as of 1.3) PNG.
public ImageIcon (Image image)
  Creates an ImageIcon from an image object.
public ImageIcon (Image image, String description)
  Creates an ImageIcon from the image.
public ImageIcon (String filename)
  Creates an ImageIcon from the specified file.
public ImageIcon (String filename, String description)
  Creates an ImageIcon from the specified file.
public ImageIcon (URL location)
  Creates an ImageIcon from the specified URL.
public ImageIcon (URL location, String description)
  Creates an ImageIcon from the specified URL.
Methods
Hide/Show inherited methods
public AccessibleContext getAccessibleContext () [Specified in Accessible]
  Gets the AccessibleContext associated with this ImageIcon.
public String getDescription ()
  Gets the description of the image.
public int getIconHeight () [Specified in Icon]
  Gets the height of the icon.
public int getIconWidth () [Specified in Icon]
  Gets the width of the icon.
public Image getImage ()
  Returns this icon's Image.
public int getImageLoadStatus ()
  Returns the status of the image loading operation.
public ImageObserver getImageObserver ()
  Returns the image observer for the image.
protected void loadImage (Image image)
  Loads the image, returning only when the image is loaded.
publicsynchronized void paintIcon (Component c, Graphics g, int x, int y) [Specified in Icon]
  Paints the icon.
public void setDescription (String description)
  Sets the description of the image.
public void setImage (Image image)
  Sets the image displayed by this icon.
public void setImageObserver (ImageObserver observer)
  Sets the image observer for the image.
public String toString ()
  Returns a string representation of this image.
Fields
Hide/Show inherited fields
protectedfinalstatic Component component
pack-private String description
pack-private int height
pack-privatetransient Image image
pack-private ImageObserver imageObserver
pack-privatetransient int loadStatus
protectedfinalstatic MediaTracker tracker
pack-private int width
Nested Classes
  ImageIcon.AccessibleImageIcon
This class implements accessibility support for the ImageIcon class.
Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar