Package de.alpharogroup.swing.icon
Class StringIcon
- java.lang.Object
-
- de.alpharogroup.swing.icon.StringIcon
-
- All Implemented Interfaces:
javax.swing.Icon
public class StringIcon extends java.lang.Object implements javax.swing.IconThe classStringIconcreates an icon with the given text
-
-
Constructor Summary
Constructors Constructor Description StringIcon(@NonNull javax.swing.JComponent component, @NonNull java.lang.String text, java.awt.Font font, java.awt.Color foreground)Instantiates a newStringIconobjectStringIcon(javax.swing.JComponent component, java.lang.String text)Instantiates a newStringIconobject
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetIconHeight()intgetIconWidth()voidpaintIcon(java.awt.Component component, java.awt.Graphics graphics, int x, int y)
-
-
-
Constructor Detail
-
StringIcon
public StringIcon(javax.swing.JComponent component, java.lang.String text)Instantiates a newStringIconobject- Parameters:
component- the componenttext- the text
-
StringIcon
public StringIcon(@NonNull @NonNull javax.swing.JComponent component, @NonNull @NonNull java.lang.String text, java.awt.Font font, java.awt.Color foreground)Instantiates a newStringIconobject- Parameters:
component- the componenttext- the textfont- the fontforeground- the foreground
-
-
Method Detail
-
getIconHeight
public int getIconHeight()
- Specified by:
getIconHeightin interfacejavax.swing.Icon
-
getIconWidth
public int getIconWidth()
- Specified by:
getIconWidthin interfacejavax.swing.Icon
-
paintIcon
public void paintIcon(java.awt.Component component, java.awt.Graphics graphics, int x, int y)- Specified by:
paintIconin interfacejavax.swing.Icon
-
-