-
- All Known Subinterfaces:
-
SynthIcon
- 所有已知实现类:
-
IconUIResource,ImageIcon,MetalCheckBoxIcon,MetalComboBoxIcon,MetalIconFactory.FileIcon16,MetalIconFactory.FolderIcon16,MetalIconFactory.PaletteCloseIcon,MetalIconFactory.TreeControlIcon,MetalIconFactory.TreeFolderIcon,MetalIconFactory.TreeLeafIcon
public interface Icon一个小的固定大小的图片,通常用于装饰组件。- 从以下版本开始:
- 1.2
- 另请参见:
-
ImageIcon
-
-
方法摘要
所有方法 接口方法 抽象方法 Modifier and Type 方法 描述 intgetIconHeight()返回图标的高度。intgetIconWidth()返回图标的宽度。voidpaintIcon(Component c, Graphics g, int x, int y)在指定位置绘制图标。
-
-
-
方法详细信息
-
paintIcon
void paintIcon(Component c, Graphics g, int x, int y)
在指定位置绘制图标。 图标实现可以使用Component参数来获取对绘画有用的属性,例如前景色或背景色。- 参数
-
c- aComponent获取有用的绘画属性 -
g- 图形上下文 -
x- 图标左上角的X坐标 -
y- 图标左上角的Y坐标
-
getIconWidth
int getIconWidth()
返回图标的宽度。- 结果
- int指定图标的固定宽度。
-
getIconHeight
int getIconHeight()
返回图标的高度。- 结果
- 一个int指定图标的固定高度。
-
-