Module is.codion.swing.common.ui
Interface LabelBuilder<T>
- Type Parameters:
T
- the type to display in the label (using value.toString() or "" for null).
- All Superinterfaces:
ComponentBuilder<T,
JLabel, LabelBuilder<T>>
A builder for JLabel.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final PropertyValue<Integer>
Specifies the default horizontal alignment used in labels Value type: Integer (SwingConstants.LEFT, SwingConstants.RIGHT, SwingConstants.CENTER) Default value:SwingConstants.LEADING
Fields inherited from interface is.codion.swing.common.ui.component.builder.ComponentBuilder
COMPONENT_VALUE, TRANSFER_FOCUS_ON_ENTER
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> LabelBuilder<T>
builder
(ValueObserver<T> linkedValueObserver) static <T> LabelBuilder<T>
static <T> LabelBuilder<T>
displayedMnemonic
(char displayedMnemonic) OverridesdisplayedMnemonic(int)
.displayedMnemonic
(int displayedMnemonic) horizontalAlignment
(int horizontalAlignment) iconTextGap
(int iconTextGap) labelFor
(JComponent component) Methods inherited from interface is.codion.swing.common.ui.component.builder.ComponentBuilder
background, border, build, build, buildValue, buildValue, clientProperty, componentListener, componentOrientation, consumer, enabled, enabled, focusable, focusCycleRoot, focusListener, font, foreground, keyEvent, keyListener, label, link, link, listener, maximumHeight, maximumSize, maximumWidth, minimumHeight, minimumSize, minimumWidth, mouseListener, mouseMotionListener, mouseWheelListener, name, onBuild, onBuildValue, onSetVisible, opaque, popupMenu, popupMenuControl, popupMenuControls, preferredHeight, preferredSize, preferredWidth, propertyChangeListener, propertyChangeListener, scrollPane, toolTipText, transferFocusOnEnter, transferHandler, validator, value, visible
-
Field Details
-
HORIZONTAL_ALIGNMENT
Specifies the default horizontal alignment used in labels- Value type: Integer (SwingConstants.LEFT, SwingConstants.RIGHT, SwingConstants.CENTER)
- Default value:
SwingConstants.LEADING
-
-
Method Details
-
horizontalAlignment
- Parameters:
horizontalAlignment
- the horizontal text alignment- Returns:
- this builder instance
- See Also:
-
displayedMnemonic
- Parameters:
displayedMnemonic
- the label mnemonic key code- Returns:
- this builder instance
- See Also:
-
displayedMnemonic
OverridesdisplayedMnemonic(int)
.- Parameters:
displayedMnemonic
- the label mnemonic character- Returns:
- this builder instance
- See Also:
-
labelFor
- Parameters:
component
- the component to associate with this label- Returns:
- this builder instance
- See Also:
-
icon
- Parameters:
icon
- the label icon- Returns:
- this builder instance
- See Also:
-
iconTextGap
- Parameters:
iconTextGap
- the icon text gap- Returns:
- this builder instance
- See Also:
-
builder
- Type Parameters:
T
- the type to display in the label (using value.toString() or "" for null).- Parameters:
icon
- the icon- Returns:
- a new builder
-
builder
- Type Parameters:
T
- the type to display in the label (using value.toString() or "" for null).- Parameters:
text
- the label text- Returns:
- a new builder
-
builder
- Type Parameters:
T
- the type to display in the label (using value.toString() or "" for null).- Parameters:
linkedValueObserver
- the value observer to link to the label text- Returns:
- a new builder
-