public class LabelFactory extends Object implements 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 |
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
Constructor and Description |
---|
LabelFactory() |
Modifier and Type | Method and Description |
---|---|
static JLabel |
create(Icon image)
Returns a new JLabel with the horizontal alignment CENTER.
|
static JLabel |
create(Icon image,
int horizontalAlignment)
Returns a new JLabel with the given horizontal alignment.
|
static JLabel |
create(String text)
Returns a new JLabel with the horizontal alignment CENTER.
|
static JLabel |
create(String text,
Icon image,
int horizontalAlignment)
Returns a new JLabel with the given horizontal alignment.
|
static JLabel |
create(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.
|
private static boolean useLabelIcons
public LabelFactory()
public static boolean isUseLabelIcons()
public static void setUseLabelIcons(boolean b)
b
- flag for the icon statepublic static JLabel create(Icon image)
image
- the image to be used as label iconpublic static JLabel create(Icon image, int horizontalAlignment)
image
- the image to be used as label iconhorizontalAlignment
- horizontal alignment of the labelpublic static JLabel create(String text)
text
- the text to be setpublic static JLabel create(String text, int horizontalAlignment)
text
- the text to be sethorizontalAlignment
- horizontal alignment of the labelpublic static JLabel create(String text, Icon image, int horizontalAlignment)
text
- the text to be setimage
- the image to be used as label iconhorizontalAlignment
- horizontal alignment of the labelWebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses