public class LayeredIcon extends ImageIcon
ImageIcon.AccessibleImageIcon| Constructor and Description |
|---|
LayeredIcon(int width,
int height) |
| Modifier and Type | Method and Description |
|---|---|
void |
addIcon(Icon icon)
Add an icon starting at the top left corner.
|
void |
addIcon(Icon icon,
int x,
int y)
Add an icon starting at a specific location.
|
void |
addIcon(Icon icon,
Point location)
Add an icon starting at a specific location.
|
void |
addIcon(Icon icon,
Point location,
int zOrder)
Add an icon starting at a specific location.
|
Component |
getComponent() |
int |
getIconCount()
Get the number of icons.
|
int |
getIconHeight() |
Point[] |
getIconLocations()
Get all the icon locations.
|
Icon[] |
getIcons()
Get all the icons.
|
int |
getIconWidth() |
Image |
getImage() |
void |
paintIcon(Component component,
Graphics g,
int x,
int y) |
void |
removeAllIcons()
Remove all icons.
|
void |
removeIcon(Icon icon)
Remove an icon.
|
void |
setComponent(Component component)
Set the component to which this icon is attached.
|
getAccessibleContext, getDescription, getImageLoadStatus, getImageObserver, loadImage, setDescription, setImage, setImageObserver, toStringpublic int getIconWidth()
getIconWidth in interface IcongetIconWidth in class ImageIconpublic int getIconHeight()
getIconHeight in interface IcongetIconHeight in class ImageIconpublic Icon[] getIcons()
public Point[] getIconLocations()
public int getIconCount()
public void removeIcon(Icon icon)
icon - the icon to remove.public void removeAllIcons()
public void addIcon(Icon icon)
icon - the icon to add.public void addIcon(Icon icon, int x, int y)
icon - the icon to add.x - the x coordinate.y - the y coordinate.public void addIcon(Icon icon, Point location)
icon - the icon to add.location - the location.public void addIcon(Icon icon, Point location, int zOrder)
icon - the icon to add.location - the location.zOrder - the zOrder of this icon, where 0 means at the back.public Component getComponent()
public void setComponent(Component component)
component - The component to attach.Copyright © 2019. All rights reserved.