nl.lxtreme.ols.util.swing.component.icon
Class TextOverlayIcon
java.lang.Object
javax.swing.ImageIcon
nl.lxtreme.ols.util.swing.component.icon.TextOverlayIcon
- All Implemented Interfaces:
- Serializable, Accessible, Icon
public class TextOverlayIcon
- extends ImageIcon
Provides an icon which takes another icon and renders a given text over it.
Note: it appears that you need to extend ImageIcon
in order to have
Swing render "disabled" (= grayed out) versions of this icon. There is no
other reason to do this.
- See Also:
- Serialized Form
Constructor Summary |
TextOverlayIcon(Icon aIcon,
String aTextOverlay)
Creates a new TextOverlayIcon instance, placing the text in the center of
the icon. |
TextOverlayIcon(Icon aIcon,
String aTextOverlay,
int aPosition)
Creates a new TextOverlayIcon instance, placing the text at the given
position. |
Methods inherited from class javax.swing.ImageIcon |
getAccessibleContext, getDescription, getIconHeight, getIconWidth, getImage, getImageLoadStatus, getImageObserver, loadImage, paintIcon, setDescription, setImage, setImageObserver, toString |
TextOverlayIcon
public TextOverlayIcon(Icon aIcon,
String aTextOverlay)
- Creates a new TextOverlayIcon instance, placing the text in the center of
the icon.
- Parameters:
aIcon
- the icon that should be overlayed;aTextOverlay
- the text that is to overlayed;
TextOverlayIcon
public TextOverlayIcon(Icon aIcon,
String aTextOverlay,
int aPosition)
- Creates a new TextOverlayIcon instance, placing the text at the given
position.
- Parameters:
aIcon
- the icon that should be overlayed;aTextOverlay
- the text that is to overlayed;aPosition
- on of the SwingConstants
values that denotes the overlay
position.
Copyright © 2012 L'Xtreme IT consultancy. All Rights Reserved.