javax.swing.Iconpublic class ColorIcon
extends java.lang.Object
implements javax.swing.Icon
| Constructor | Description |
|---|---|
ColorIcon(java.awt.Color color,
int width,
int height) |
Constructs a ColorIcon.
|
ColorIcon(java.awt.Color fillColor,
java.awt.Color outlineColor,
int width,
int height) |
Constructs an outlined ColorIcon.
|
| Modifier and Type | Method | Description |
|---|---|---|
int |
getIconHeight() |
Gets the icon height.
|
int |
getIconWidth() |
Gets the icon width.
|
void |
paintIcon(java.awt.Component c,
java.awt.Graphics _g,
int x,
int y) |
Paints the icon.
|
void |
setColor(java.awt.Color color) |
Sets the color.
|
public ColorIcon(java.awt.Color color,
int width,
int height)
color - color of the iconwidth - width of the iconheight - height of the iconpublic ColorIcon(java.awt.Color fillColor,
java.awt.Color outlineColor,
int width,
int height)
fillColor - fill color of the iconoutlineColor - outline color of the iconwidth - width of the iconheight - height of the iconpublic void setColor(java.awt.Color color)
color - the desired colorpublic int getIconWidth()
getIconWidth in interface javax.swing.Iconpublic int getIconHeight()
getIconHeight in interface javax.swing.Iconpublic void paintIcon(java.awt.Component c,
java.awt.Graphics _g,
int x,
int y)
paintIcon in interface javax.swing.Iconc - the component on which it is painted_g - the graphics contextx - the x coordinate of the icony - the y coordinate of the icon