An implementation of the Icon interface that paints Icons from Images. Images that are created from a URL, filename or byte array are preloaded using MediaTracker to monitor the loaded state of the image.
For further information and examples of using image icons, see How to Use Icons in The Java Tutorial.
Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. As of 1.4, support for long term storage of all JavaBeans™ has been added to the java.beans package. Please see XMLEncoder.
An implementation of the Icon interface that paints Icons from Images. Images that are created from a URL, filename or byte array are preloaded using MediaTracker to monitor the loaded state of the image. For further information and examples of using image icons, see How to Use Icons in The Java Tutorial. Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. As of 1.4, support for long term storage of all JavaBeans™ has been added to the java.beans package. Please see XMLEncoder.
(->image-icon)
(->image-icon filename)
(->image-icon filename description)
Constructor.
Creates an ImageIcon from the specified file. The image will be preloaded by using MediaTracker to monitor the loading state of the image.
filename - the name of the file containing the image - java.lang.String
description - a brief textual description of the image - java.lang.String
Constructor. Creates an ImageIcon from the specified file. The image will be preloaded by using MediaTracker to monitor the loading state of the image. filename - the name of the file containing the image - `java.lang.String` description - a brief textual description of the image - `java.lang.String`
(get-accessible-context this)
Gets the AccessibleContext associated with this ImageIcon. For image icons, the AccessibleContext takes the form of an AccessibleImageIcon. A new AccessibleImageIcon instance is created if necessary.
returns: an AccessibleImageIcon that serves as the
AccessibleContext of this ImageIcon - javax.accessibility.AccessibleContext
Gets the AccessibleContext associated with this ImageIcon. For image icons, the AccessibleContext takes the form of an AccessibleImageIcon. A new AccessibleImageIcon instance is created if necessary. returns: an AccessibleImageIcon that serves as the AccessibleContext of this ImageIcon - `javax.accessibility.AccessibleContext`
(get-description this)
Gets the description of the image. This is meant to be a brief textual description of the object. For example, it might be presented to a blind user to give an indication of the purpose of the image. The description may be null.
returns: a brief textual description of the image - java.lang.String
Gets the description of the image. This is meant to be a brief textual description of the object. For example, it might be presented to a blind user to give an indication of the purpose of the image. The description may be null. returns: a brief textual description of the image - `java.lang.String`
(get-icon-height this)
Gets the height of the icon.
returns: the height in pixels of this icon - int
Gets the height of the icon. returns: the height in pixels of this icon - `int`
(get-icon-width this)
Gets the width of the icon.
returns: the width in pixels of this icon - int
Gets the width of the icon. returns: the width in pixels of this icon - `int`
(get-image this)
Returns this icon's Image.
returns: the Image object for this ImageIcon - java.awt.Image
Returns this icon's Image. returns: the Image object for this ImageIcon - `java.awt.Image`
(get-image-load-status this)
Returns the status of the image loading operation.
returns: the loading status as defined by java.awt.MediaTracker - int
Returns the status of the image loading operation. returns: the loading status as defined by java.awt.MediaTracker - `int`
(get-image-observer this)
Returns the image observer for the image.
returns: the image observer, which may be null - java.awt.image.ImageObserver
Returns the image observer for the image. returns: the image observer, which may be null - `java.awt.image.ImageObserver`
(paint-icon this c g x y)
Paints the icon. The top-left corner of the icon is drawn at the point (x, y) in the coordinate space of the graphics context g. If this icon has no image observer, this method uses the c component as the observer.
c - the component to be used as the observer if this icon has no image observer - java.awt.Component
g - the graphics context - java.awt.Graphics
x - the X coordinate of the icon's top-left corner - int
y - the Y coordinate of the icon's top-left corner - int
Paints the icon. The top-left corner of the icon is drawn at the point (x, y) in the coordinate space of the graphics context g. If this icon has no image observer, this method uses the c component as the observer. c - the component to be used as the observer if this icon has no image observer - `java.awt.Component` g - the graphics context - `java.awt.Graphics` x - the X coordinate of the icon's top-left corner - `int` y - the Y coordinate of the icon's top-left corner - `int`
(set-description this description)
Sets the description of the image. This is meant to be a brief textual description of the object. For example, it might be presented to a blind user to give an indication of the purpose of the image.
description - a brief textual description of the image - java.lang.String
Sets the description of the image. This is meant to be a brief textual description of the object. For example, it might be presented to a blind user to give an indication of the purpose of the image. description - a brief textual description of the image - `java.lang.String`
(set-image this image)
Sets the image displayed by this icon.
image - the image - java.awt.Image
Sets the image displayed by this icon. image - the image - `java.awt.Image`
(set-image-observer this observer)
Sets the image observer for the image. Set this property if the ImageIcon contains an animated GIF, so the observer is notified to update its display. For example:
icon = new ImageIcon(...)
button.setIcon(icon);
icon.setImageObserver(button);
observer - the image observer - java.awt.image.ImageObserver
Sets the image observer for the image. Set this property if the ImageIcon contains an animated GIF, so the observer is notified to update its display. For example: icon = new ImageIcon(...) button.setIcon(icon); icon.setImageObserver(button); observer - the image observer - `java.awt.image.ImageObserver`
(to-string this)
Returns a string representation of this image.
returns: a string representing this image - java.lang.String
Returns a string representation of this image. returns: a string representing this image - `java.lang.String`
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close