Java javax.swing ImageIcon fields, constructors, methods, implement or subclass

Example usage for Java javax.swing ImageIcon fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for javax.swing ImageIcon.

The text is from its open source code.

Subclass

javax.swing.ImageIcon has subclasses.
Click this link to see all its subclasses.

Constructor

ImageIcon(String filename)
Creates an ImageIcon from the specified file.
ImageIcon(URL location)
Creates an ImageIcon from the specified URL.
ImageIcon(Image image)
Creates an ImageIcon from an image object.
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.
ImageIcon(String filename, String description)
Creates an ImageIcon from the specified file.
ImageIcon(URL location, String description)
Creates an ImageIcon from the specified URL.
ImageIcon(Image image, String description)
Creates an ImageIcon from the image.
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.
ImageIcon()
Creates an uninitialized image icon.

Method

StringgetDescription()
Gets the description of the image.
intgetIconHeight()
Gets the height of the icon.
intgetIconWidth()
Gets the width of the icon.
ImagegetImage()
Returns this icon's Image.
intgetImageLoadStatus()
Returns the status of the image loading operation.
ImageObservergetImageObserver()
Returns the image observer for the image.
voidpaintIcon(Component c, Graphics g, int x, int y)
Paints the icon.
voidsetDescription(String description)
Sets the description of the image.
voidsetImage(Image image)
Sets the image displayed by this icon.
voidsetImageObserver(ImageObserver observer)
Sets the image observer for the image.
StringtoString()
Returns a string representation of this image.