getIcon
getIcon: (JLabel) -> Icon?The icon: an ImageIcon or the plugin's own Icon table, or nil.
JLabel.new(…)| Method | Returns | Description |
|---|---|---|
getIcon() | Icon? | The icon: an ImageIcon or the plugin's own Icon table, or nil. |
setIcon(any) | () | Shows icon (an ImageIcon, or a table with getIconWidth, getIconHeight and paintIcon) beside the text; nil removes it. |
getText() | string? | The text, or nil. |
setText(string?) | () | Sets the text (plain, or <html>...); a changed text lays the label out again and repaints it. |
getHorizontalAlignment() | number | The horizontal alignment. |
setHorizontalAlignment(number) | () | Aligns the label's contents horizontally (JLabel.LEFT, CENTER, RIGHT, LEADING, TRAILING). |
getVerticalAlignment() | number | The vertical alignment. |
setVerticalAlignment(number) | () | Aligns the label's contents vertically (JLabel.TOP, CENTER, BOTTOM). |
setHorizontalTextPosition(number) | () | Where the text sits beside the icon, horizontally. |
setVerticalTextPosition(number) | () | Where the text sits beside the icon, vertically. |
getIconTextGap() | number | The gap between the icon and the text. |
setIconTextGap(number) | () | Sets the gap between the icon and the text. |
getLabelFor() | Component? | The component this label labels, or nil. |
setLabelFor(Component?) | () | Names the component this label labels. |
new(string?, number) | JLabel | () -> JLabel: An empty label. |
new(any) | JLabel | |
new(string?, any, number) | JLabel | |
init(JLabel, string?, number) | () | (JLabel) -> (): An empty label. |
init(JLabel, any) | () | |
init(JLabel, string?, any, number) | () | |
isInstance(any) | boolean | Whether obj is a JLabel object, a class(JLabel) subclass's included. |
| Field | Type | Description |
|---|---|---|
CENTER | number | SwingConstants.CENTER: 0. |
TOP | number | SwingConstants.TOP: 1. |
LEFT | number | SwingConstants.LEFT: 2. |
BOTTOM | number | SwingConstants.BOTTOM: 3. |
RIGHT | number | SwingConstants.RIGHT: 4. |
LEADING | number | SwingConstants.LEADING: 10. |
TRAILING | number | SwingConstants.TRAILING: 11. |
super | JComponentClass | JComponent's class table: the base class. |
| Method | Returns | Description |
|---|---|---|
JLabelClass.new | JLabel | () -> JLabel: An empty label. |
getIcongetIcon: (JLabel) -> Icon?The icon: an ImageIcon or the plugin's own Icon table, or nil.
setIconsetIcon: (JLabel, any) -> ()Shows icon (an ImageIcon, or a table with getIconWidth, getIconHeight and paintIcon) beside the text; nil removes it.
getTextgetText: (JLabel) -> string?The text, or nil.
setTextsetText: (JLabel, string?) -> ()Sets the text (plain, or <html>...); a changed text lays the label out again and repaints it.
getHorizontalAlignmentgetHorizontalAlignment: (JLabel) -> numberThe horizontal alignment.
setHorizontalAlignmentsetHorizontalAlignment: (JLabel, number) -> ()Aligns the label's contents horizontally (JLabel.LEFT, CENTER, RIGHT, LEADING, TRAILING).
getVerticalAlignmentgetVerticalAlignment: (JLabel) -> numberThe vertical alignment.
setVerticalAlignmentsetVerticalAlignment: (JLabel, number) -> ()Aligns the label's contents vertically (JLabel.TOP, CENTER, BOTTOM).
setHorizontalTextPositionsetHorizontalTextPosition: (JLabel, number) -> ()Where the text sits beside the icon, horizontally.
setVerticalTextPositionsetVerticalTextPosition: (JLabel, number) -> ()Where the text sits beside the icon, vertically.
getIconTextGapgetIconTextGap: (JLabel) -> numberThe gap between the icon and the text.
setIconTextGapsetIconTextGap: (JLabel, number) -> ()Sets the gap between the icon and the text.
getLabelForgetLabelFor: (JLabel) -> Component?The component this label labels, or nil.
setLabelForsetLabelFor: (JLabel, Component?) -> ()Names the component this label labels.
newnew: ((string?, number) -> JLabel) & ((any) -> JLabel) & ((string?, any, number) -> JLabel)() -> JLabel: An empty label.
(string?) -> JLabel: A label showing text, leading-aligned.
(string?, number) -> JLabel: A label showing text, aligned by horizontalAlignment (JLabel.LEFT, CENTER, RIGHT, LEADING, TRAILING).
(any) -> JLabel: A label showing image, centred.
(string?, any, number) -> JLabel: A label showing text and icon, aligned by horizontalAlignment.
initinit: ((JLabel, string?, number) -> ()) & ((JLabel, any) -> ()) & ((JLabel, string?, any, number) -> ())(JLabel) -> (): An empty label.
(JLabel, string?) -> (): A label showing text, leading-aligned.
(JLabel, string?, number) -> (): A label showing text, aligned by horizontalAlignment (JLabel.LEFT, CENTER, RIGHT, LEADING, TRAILING).
(JLabel, any) -> (): A label showing image, centred.
(JLabel, string?, any, number) -> (): A label showing text and icon, aligned by horizontalAlignment.
isInstanceisInstance: (any) -> booleanWhether obj is a JLabel object, a class(JLabel) subclass's included.