APIdia Launch Partner
Top Description Methods
javax.swing

public Interface Icon

Known Direct Subinterfaces
javax.swing.plaf.synth.SynthIcon
Known Direct Implementers
javax.swing.ImageIcon, javax.swing.plaf.IconUIResource, javax.swing.plaf.basic.BasicIconFactory.EmptyFrameIcon, javax.swing.plaf.basic.BasicIconFactory.CheckBoxIcon, javax.swing.plaf.basic.BasicIconFactory.RadioButtonIcon, javax.swing.plaf.basic.BasicIconFactory.CheckBoxMenuItemIcon, javax.swing.plaf.basic.BasicIconFactory.RadioButtonMenuItemIcon, javax.swing.plaf.basic.BasicIconFactory.MenuItemCheckIcon, javax.swing.plaf.basic.BasicIconFactory.MenuItemArrowIcon, javax.swing.plaf.basic.BasicIconFactory.MenuArrowIcon, javax.swing.plaf.metal.MetalBumps, javax.swing.plaf.metal.MetalCheckBoxIcon, javax.swing.plaf.metal.MetalComboBoxIcon, javax.swing.plaf.metal.MetalFileChooserUI.IndentIcon, javax.swing.plaf.metal.MetalIconFactory.FileChooserDetailViewIcon, javax.swing.plaf.metal.MetalIconFactory.FileChooserHomeFolderIcon, javax.swing.plaf.metal.MetalIconFactory.FileChooserListViewIcon, javax.swing.plaf.metal.MetalIconFactory.FileChooserNewFolderIcon, javax.swing.plaf.metal.MetalIconFactory.FileChooserUpFolderIcon, javax.swing.plaf.metal.MetalIconFactory.PaletteCloseIcon, javax.swing.plaf.metal.MetalIconFactory.InternalFrameCloseIcon, javax.swing.plaf.metal.MetalIconFactory.InternalFrameAltMaximizeIcon, javax.swing.plaf.metal.MetalIconFactory.InternalFrameDefaultMenuIcon, javax.swing.plaf.metal.MetalIconFactory.InternalFrameMaximizeIcon, javax.swing.plaf.metal.MetalIconFactory.InternalFrameMinimizeIcon, javax.swing.plaf.metal.MetalIconFactory.CheckBoxIcon, javax.swing.plaf.metal.MetalIconFactory.RadioButtonIcon, javax.swing.plaf.metal.MetalIconFactory.TreeComputerIcon, javax.swing.plaf.metal.MetalIconFactory.TreeHardDriveIcon, javax.swing.plaf.metal.MetalIconFactory.TreeFloppyDriveIcon, javax.swing.plaf.metal.MetalIconFactory.FolderIcon16, javax.swing.plaf.metal.MetalIconFactory.FileIcon16, javax.swing.plaf.metal.MetalIconFactory.TreeControlIcon, javax.swing.plaf.metal.MetalIconFactory.MenuArrowIcon, javax.swing.plaf.metal.MetalIconFactory.MenuItemArrowIcon, javax.swing.plaf.metal.MetalIconFactory.CheckBoxMenuItemIcon, javax.swing.plaf.metal.MetalIconFactory.RadioButtonMenuItemIcon, javax.swing.plaf.metal.MetalIconFactory.VerticalSliderThumbIcon, javax.swing.plaf.metal.MetalIconFactory.HorizontalSliderThumbIcon, javax.swing.plaf.metal.MetalIconFactory.OceanVerticalSliderThumbIcon, javax.swing.plaf.metal.MetalIconFactory.OceanHorizontalSliderThumbIcon, javax.swing.plaf.synth.SynthGraphicsUtils.SynthIconWrapper, com.sun.java.swing.plaf.motif.MotifComboBoxUI.MotifComboBoxArrowIcon, com.sun.java.swing.plaf.motif.MotifIconFactory.CheckBoxIcon, com.sun.java.swing.plaf.motif.MotifIconFactory.RadioButtonIcon, com.sun.java.swing.plaf.motif.MotifIconFactory.MenuItemCheckIcon, com.sun.java.swing.plaf.motif.MotifIconFactory.MenuItemArrowIcon, com.sun.java.swing.plaf.motif.MotifIconFactory.MenuArrowIcon, com.sun.java.swing.plaf.motif.MotifTreeCellRenderer.TreeLeafIcon, com.sun.java.swing.plaf.motif.MotifTreeUI.MotifExpandedIcon, sun.swing.icon.SortArrowIcon, sun.swing.plaf.synth.SynthFileChooserUIImpl.IndentIcon, sun.swing.table.DefaultTableCellHeaderRenderer.EmptyIcon
Imports
java.awt.Graphics, .Component

A small fixed size picture, typically used to decorate components.
Since
1.2
See Also
ImageIcon

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

an int specifying the fixed height of the icon.
getIconHeight
()

Returns the icon's height.

public int

Returns:

an int specifying the fixed width of the icon.
getIconWidth
()

Returns the icon's width.

public void
paintIcon(Component
a Component to get properties useful for painting
c
,
Graphics
the graphics context
g
,
int
the X coordinate of the icon's top-left corner
x
,
int
the Y coordinate of the icon's top-left corner
y
)

Draw the icon at the specified location.

Method Detail

getIconHeightback to summary
public int getIconHeight()

Returns the icon's height.

Returns:int

an int specifying the fixed height of the icon.

getIconWidthback to summary
public int getIconWidth()

Returns the icon's width.

Returns:int

an int specifying the fixed width of the icon.

paintIconback to summary
public void paintIcon(Component c, 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.

Parameters
c:Component

a Component to get properties useful for painting

g:Graphics

the graphics context

x:int

the X coordinate of the icon's top-left corner

y:int

the Y coordinate of the icon's top-left corner