final class EmptyIcon extends Object implements Icon
Intended for use with Action and JMenuItem. Alignment of text is poor when the same menu mixes menu items without an icon with menu items having an icon. In such cases, items without an icon can use an EmptyIcon to take up the proper amount of space, and allow for alignment of all text in the menu.
Modifier and Type | Field and Description |
---|---|
(package private) static EmptyIcon |
SIZE_16
Convenience object for small icons, whose size matches the size of
small icons in Sun's graphics repository.
|
(package private) static EmptyIcon |
SIZE_24
Convenience object for large icons, whose size matches the size of
large icons in Sun's graphics repository.
|
Constructor and Description |
---|
EmptyIcon(int aSize)
EmptyIcon objects are always square, having identical height and width.
|
Modifier and Type | Method and Description |
---|---|
int |
getIconHeight()
Return the icon size (width is same as height).
|
int |
getIconWidth()
Return the icon size (width is same as height).
|
void |
paintIcon(Component c,
Graphics g,
int x,
int y)
This implementation is empty, and paints nothing.
|
static final EmptyIcon SIZE_16
EmptyIcon(int aSize)
aSize
- length of any side of the icon in pixels, must
be in the range 1..100 (inclusive).public int getIconWidth()
getIconWidth
in interface Icon
public int getIconHeight()
getIconHeight
in interface Icon
Copyright Hirondelle Systems - License - Generated 2013Sep20.10.58