public class LabelFactory
extends java.lang.Object
implements javax.swing.SwingConstants
A label factory which can handle modified look like to present icons or present it not.
| Modifier and Type | Field and Description |
|---|---|
private static boolean |
useLabelIcons |
| Constructor and Description |
|---|
LabelFactory() |
| Modifier and Type | Method and Description |
|---|---|
static javax.swing.JLabel |
create(javax.swing.Icon image)
Returns a new JLabel with the horizontal alignment CENTER.
|
static javax.swing.JLabel |
create(javax.swing.Icon image,
int horizontalAlignment)
Returns a new JLabel with the given horizontal alignment.
|
static javax.swing.JLabel |
create(java.lang.String text)
Returns a new JLabel with the horizontal alignment CENTER.
|
static javax.swing.JLabel |
create(java.lang.String text,
javax.swing.Icon image,
int horizontalAlignment)
Returns a new JLabel with the given horizontal alignment.
|
static javax.swing.JLabel |
create(java.lang.String text,
int horizontalAlignment)
Returns a new JLabel with the given horizontal alignment.
|
static boolean |
isUseLabelIcons()
Returns whether the factory creates labels with icons or without icons.
|
static void |
setUseLabelIcons(boolean b)
Sets the use icon state.
|
public static boolean isUseLabelIcons()
public static void setUseLabelIcons(boolean b)
b - flag for the icon statepublic static javax.swing.JLabel create(javax.swing.Icon image)
image - the image to be used as label iconpublic static javax.swing.JLabel create(javax.swing.Icon image,
int horizontalAlignment)
image - the image to be used as label iconhorizontalAlignment - horizontal alignment of the labelpublic static javax.swing.JLabel create(java.lang.String text)
text - the text to be setpublic static javax.swing.JLabel create(java.lang.String text,
int horizontalAlignment)
text - the text to be sethorizontalAlignment - horizontal alignment of the labelpublic static javax.swing.JLabel create(java.lang.String text,
javax.swing.Icon image,
int horizontalAlignment)
text - the text to be setimage - the image to be used as label iconhorizontalAlignment - horizontal alignment of the label