javax.swing
Interface Icon

All Known Implementing Classes:
IconUIResource sample code for javax.swing.plaf.IconUIResource definition code for javax.swing.plaf.IconUIResource , ImageIcon sample code for javax.swing.ImageIcon definition code for javax.swing.ImageIcon , MetalCheckBoxIcon sample code for javax.swing.plaf.metal.MetalCheckBoxIcon definition code for javax.swing.plaf.metal.MetalCheckBoxIcon , MetalComboBoxIcon sample code for javax.swing.plaf.metal.MetalComboBoxIcon definition code for javax.swing.plaf.metal.MetalComboBoxIcon , MetalIconFactory.FileIcon16 sample code for javax.swing.plaf.metal.MetalIconFactory.FileIcon16 definition code for javax.swing.plaf.metal.MetalIconFactory.FileIcon16 , MetalIconFactory.FolderIcon16 sample code for javax.swing.plaf.metal.MetalIconFactory.FolderIcon16 definition code for javax.swing.plaf.metal.MetalIconFactory.FolderIcon16 , MetalIconFactory.PaletteCloseIcon sample code for javax.swing.plaf.metal.MetalIconFactory.PaletteCloseIcon definition code for javax.swing.plaf.metal.MetalIconFactory.PaletteCloseIcon , MetalIconFactory.TreeControlIcon sample code for javax.swing.plaf.metal.MetalIconFactory.TreeControlIcon definition code for javax.swing.plaf.metal.MetalIconFactory.TreeControlIcon , MetalIconFactory.TreeFolderIcon sample code for javax.swing.plaf.metal.MetalIconFactory.TreeFolderIcon definition code for javax.swing.plaf.metal.MetalIconFactory.TreeFolderIcon , MetalIconFactory.TreeLeafIcon sample code for javax.swing.plaf.metal.MetalIconFactory.TreeLeafIcon definition code for javax.swing.plaf.metal.MetalIconFactory.TreeLeafIcon

public interface Icon

A small fixed size picture, typically used to decorate components.

See Also:
ImageIcon sample code for javax.swing.ImageIcon definition code for javax.swing.ImageIcon

Method Summary
 int getIconHeight sample code for javax.swing.Icon.getIconHeight() definition code for javax.swing.Icon.getIconHeight() ()
          Returns the icon's height.
 int getIconWidth sample code for javax.swing.Icon.getIconWidth() definition code for javax.swing.Icon.getIconWidth() ()
          Returns the icon's width.
 void paintIcon sample code for javax.swing.Icon.paintIcon(java.awt.Component, java.awt.Graphics, int, int) definition code for javax.swing.Icon.paintIcon(java.awt.Component, java.awt.Graphics, int, int) (Component sample code for java.awt.Component definition code for java.awt.Component  c, Graphics sample code for java.awt.Graphics definition code for java.awt.Graphics  g, int x, int y)
          Draw the icon at the specified location.
 

Method Detail

paintIcon sample code for javax.swing.Icon.paintIcon(java.awt.Component, java.awt.Graphics, int, int) definition code for javax.swing.Icon.paintIcon(java.awt.Component, java.awt.Graphics, int, int)

void paintIcon(Component sample code for java.awt.Component definition code for java.awt.Component  c,
               Graphics sample code for java.awt.Graphics definition code for java.awt.Graphics  g,
               int x,
               int y)
Draw the icon at the specified location. Icon implementations may use the Component argument to get properties useful for painting, e.g. the foreground or background color.


getIconWidth sample code for javax.swing.Icon.getIconWidth() definition code for javax.swing.Icon.getIconWidth()

int getIconWidth()
Returns the icon's width.

Returns:
an int specifying the fixed width of the icon.

getIconHeight sample code for javax.swing.Icon.getIconHeight() definition code for javax.swing.Icon.getIconHeight()

int getIconHeight()
Returns the icon's height.

Returns:
an int specifying the fixed height of the icon.