[117:7] extends: Control
Labeled is the abstract base class for JavaFX controls that display text and/or a graphic. It defines all text rendering, font, alignment, and graphic-positioning properties shared by Label, Button, CheckBox, ToggleButton, RadioButton, Hyperlink, TitledPane, and similar controls. Every subclass of Labeled automatically inherits the CSS properties listed in the Labeled table below, in addition to the Control, Region, and Node properties.
| Property | Values | Default | Description |
|---|---|---|---|
-fx-alignment |
top-left | top-center | top-right | center-left | center | center-right | bottom-left | bottom-center | bottom-right | baseline-left | baseline-center | baseline-right |
center-left |
Aligns the content (text + graphic) within the control bounds. |
-fx-text-alignment |
left | center | right | justify |
left |
Horizontal alignment of multi-line text within the text area. |
-fx-text-overrun |
clip | ellipsis | word-ellipsis | center-ellipsis | center-word-ellipsis | leading-ellipsis | leading-word-ellipsis |
ellipsis |
Behavior when the label text is too long to fit. ellipsis appends "..." at the truncation point. |
-fx-wrap-text |
true | false |
false |
When true, text wraps to additional lines instead of being truncated. |
-fx-font |
<font> |
platform default (inherits) | Shorthand for the font used to render the label text. Inherits from parent by default. |
-fx-underline |
true | false |
false |
When true, an underline is drawn beneath the label text. |
-fx-graphic |
<uri> |
null |
URI of an image to display alongside the label text as the control graphic. |
-fx-content-display |
top | right | bottom | left | center | graphic-only | text-only |
left |
Position of the graphic relative to the text. |
-fx-graphic-text-gap |
<size> |
4 |
Pixel gap between the graphic and the text. |
-fx-label-padding |
<size> or <top> <right> <bottom> <left> |
0 0 0 0 |
Extra padding added around the label content inside the control bounds. |
-fx-text-fill |
<paint> |
black |
Color of the label text. |
-fx-ellipsis-string |
<string> |
"..." |
The string appended when text is truncated with an ellipsis overrun style. |
-fx-line-spacing |
<size> |
0 |
Additional space added between lines of wrapped text. |
| Property | Values | Default | Description |
|---|---|---|---|
-fx-skin |
<string> |
null |
Fully qualified class name of the Skin to use for rendering this control. |
-fx-focus-traversable |
true | false |
true |
When true, the control participates in focus traversal via the keyboard Tab key. |
| Property | Values | Default | Description |
|---|---|---|---|
-fx-background-color |
<paint> [, <paint>]* |
transparent |
One or more paint values for background fill layers, rendered back to front. |
-fx-background-insets |
<size> or <t> <r> <b> <l> [, ...]* |
0 0 0 0 |
Insets from the region edges for each background fill layer. |
-fx-background-radius |
<size> [/ <size>]* [, ...]* |
0 0 0 0 |
Corner radii for each background fill layer. |
| Property | Values | Default | Description |
|---|---|---|---|
-fx-background-image |
<uri> [, <uri>]* |
null |
One or more image URIs for background image layers. |
-fx-background-position |
<bg-position> [, ...]* |
0% 0% |
Position of each background image within the region. Accepts keywords or size values. |
-fx-background-repeat |
<repeat-style> [, ...]* |
repeat repeat |
Tiling behavior for each background image. Values: repeat, no-repeat, round, space applied per axis. |
-fx-background-size |
<bg-size> [, ...]* |
auto auto |
Dimensions for each background image. Supports cover, contain, stretch, or explicit sizes. |
| Property | Values | Default | Description |
|---|---|---|---|
-fx-border-color |
<paint> or <t> <r> <b> <l> [, ...]* |
null |
Paint colors for the border stroke layers. |
-fx-border-insets |
<size> or <t> <r> <b> <l> [, ...]* |
null |
Insets from region edges for each border layer. |
-fx-border-radius |
<size> [, ...]* |
null |
Corner radii for border stroke layers. |
-fx-border-style |
<border-style> [, ...]* |
null |
Border line style (solid, dotted, dashed) plus phase and line cap/join options per layer. |
-fx-border-width |
<size> or <t> <r> <b> <l> [, ...]* |
null |
Thickness of each border stroke layer, per side. |
| Property | Values | Default | Description |
|---|---|---|---|
-fx-border-image-source |
<uri> [, <uri>]* |
null |
Image URIs used to paint the border. |
-fx-border-image-insets |
<size> or <t> <r> <b> <l> [, ...]* |
0 0 0 0 |
Insets for each border image layer. |
-fx-border-image-repeat |
<repeat-style> [, ...]* |
repeat repeat |
Tiling behavior for each border image. |
-fx-border-image-slice |
<size> or <t> <r> <b> <l> [fill] [, ...]* |
100% |
Divides each border image into nine regions. Adding fill preserves the center region. |
-fx-border-image-width |
<size> or <t> <r> <b> <l> [, ...]* |
1 1 1 1 |
Width of each border image slice per side. |
| Property | Values | Default | Description |
|---|---|---|---|
-fx-padding |
<size> or <t> <r> <b> <l> |
0 0 0 0 |
Interior padding between the region border and its content. |
-fx-shape |
<string> |
null |
SVG path string that defines a custom clip shape for the region. |
-fx-scale-shape |
true | false |
true |
When true, the shape is scaled to fit the region. |
-fx-position-shape |
true | false |
true |
When true, the shape is centered within the region. |
-fx-snap-to-pixel |
true | false |
true |
When true, positions and sizes are rounded to whole pixel boundaries. |
-fx-min-width |
<size> |
-1 |
Minimum width. -1 uses the computed minimum. |
-fx-pref-width |
<size> |
-1 |
Preferred width. -1 uses the computed preferred. |
-fx-max-width |
<size> |
-1 |
Maximum width. -1 uses the computed maximum. |
-fx-min-height |
<size> |
-1 |
Minimum height. -1 uses the computed minimum. |
-fx-pref-height |
<size> |
-1 |
Preferred height. -1 uses the computed preferred. |
-fx-max-height |
<size> |
-1 |
Maximum height. -1 uses the computed maximum. |
| Property | Values | Default | Description |
|---|---|---|---|
-fx-blend-mode |
add | blue | color-burn | color-dodge | darken | difference | exclusion | green | hard-light | lighten | multiply | overlay | red | screen | soft-light | src-atop | src-in | src-out | src-over |
null |
Blend mode used when compositing this node with nodes beneath it. |
-fx-cursor |
null | crosshair | default | hand | move | e-resize | h-resize | ne-resize | nw-resize | n-resize | se-resize | sw-resize | s-resize | w-resize | v-resize | text | wait | <url> |
null (inherits) |
Mouse cursor shape shown when the pointer is over this node. Inherits from parent by default. |
-fx-effect |
<effect> |
null |
A visual effect (e.g. DropShadow, InnerShadow) applied to the rendered node. |
-fx-focus-traversable |
true | false |
false |
Whether this node participates in focus traversal. Overridden to true by Control. |
-fx-view-order |
<number> |
0 |
Adjusts rendering and hit-test order within the parent without changing the scene graph order. |
-fx-opacity |
<number> [0.0 - 1.0] |
1 |
Opacity of the node. 0 is fully transparent, 1 is fully opaque. |
-fx-rotate |
<number> |
0 |
Rotation angle in degrees applied around the node's center point. Positive values are clockwise. |
-fx-scale-x |
<number> |
1 |
Scale factor along the X axis about the node's center. |
-fx-scale-y |
<number> |
1 |
Scale factor along the Y axis about the node's center. |
-fx-scale-z |
<number> |
1 |
Scale factor along the Z axis about the node's center. |
-fx-translate-x |
<number> |
0 |
Translation offset along the X axis in pixels. |
-fx-translate-y |
<number> |
0 |
Translation offset along the Y axis in pixels. |
-fx-translate-z |
<number> |
0 |
Translation offset along the Z axis in pixels. |
visibility |
visible | hidden | collapse | inherit |
visible |
Controls whether the node is rendered and participates in layout. collapse removes it from layout; hidden keeps the space. |
-fx-managed |
true | false |
true |
When false, the parent layout does not manage this node's position or size. |
Labeled ()
Empty default constructor; populated by adopt. Labeled is abstract in JavaFX.
adopt (object Ajo)
Wraps an existing javafx.scene.control.Labeled AussomJavaObject in a Labeled wrapper.
Ajo is the AussomJavaObject around a javafx.scene.control.Labeled instance.A new Labeled wrapper around the provided object.textProperty ()
Returns the text property used to bind or observe the label text.
An AussomJavaObject around a StringProperty.setText (string Text)
Sets the text label displayed by the control.
Text is the string to show, or null to clear the text.this objectgetText ()
Returns the current text label of the control.
A string with the displayed text, or null when unset.alignmentProperty ()
Returns the alignment property used to position the text and graphic inside the control bounds.
An AussomJavaObject around an ObjectPropertysetAlignment (object Alignment)
Sets the alignment of the text and graphic within the control bounds.
Alignment is an AussomJavaObject around a javafx.geometry.Pos value.this objectgetAlignment ()
Returns the current alignment used to position text and graphic.
An AussomJavaObject around a javafx.geometry.Pos value.textAlignmentProperty ()
Returns the textAlignment property controlling horizontal alignment of multi-line text within the text area.
An AussomJavaObject around an ObjectPropertysetTextAlignment (object TextAlignment)
Sets the horizontal alignment used for multi-line text inside the text area of the control.
TextAlignment is an AussomJavaObject around a javafx.scene.text.TextAlignment value.this objectgetTextAlignment ()
Returns the current multi-line text alignment.
An AussomJavaObject around a javafx.scene.text.TextAlignment value.textOverrunProperty ()
Returns the textOverrun property that controls how text is truncated when it does not fit in the control bounds.
An AussomJavaObject around an ObjectPropertysetTextOverrun (object TextOverrun)
Sets the overrun behavior applied when the text is too long to fit.
TextOverrun is an AussomJavaObject around a javafx.scene.control.OverrunStyle value.this objectgetTextOverrun ()
Returns the currently configured overrun behavior.
An AussomJavaObject around a javafx.scene.control.OverrunStyle value.ellipsisStringProperty ()
Returns the ellipsisString property that holds the string appended when text is truncated using an ellipsis overrun style.
An AussomJavaObject around a StringProperty.setEllipsisString (string EllipsisString)
Sets the string appended when the text is truncated by an ellipsis overrun style (defaults to "...").
EllipsisString is the string to use in place of the truncated text.this objectgetEllipsisString ()
Returns the currently configured ellipsis truncation string.
A string with the ellipsis truncation value.wrapTextProperty ()
Returns the wrapText property controlling whether long text wraps onto additional lines instead of being truncated.
An AussomJavaObject around a BooleanProperty.setWrapText (bool WrapText)
Sets whether the text wraps onto additional lines when it does not fit on a single line.
WrapText is a bool; true wraps the text, false truncates per the overrun style.this objectisWrapText ()
Returns whether the text is configured to wrap onto multiple lines.
A bool that is true when wrapping is enabled.getContentBias ()
Returns the layout content bias for this control. The bias indicates whether the preferred size depends on the other dimension.
An AussomJavaObject around a javafx.geometry.Orientation value, or null.fontProperty ()
Returns the font property used to render the label text.
An AussomJavaObject around an ObjectProperty.setFont (object FontObj)
Sets the font used to render the label text.
FontObj is a Font wrapper instance whose .obj holds the javafx.scene.text.Font value.this objectgetFont ()
Returns the font currently used to render the label text.
An AussomJavaObject around a javafx.scene.text.Font value.graphicProperty ()
Returns the graphic property holding the optional Node rendered alongside the text.
An AussomJavaObject around an ObjectPropertysetGraphic (object Graphic)
Sets the graphic node displayed alongside the label text.
Graphic is an Aussom wrapper (e.g. ImageView) whose .obj holds the javafx.scene.Node.this objectgetGraphic ()
Returns the graphic Node currently shown alongside the label text.
An AussomJavaObject around the graphic Node, or null when unset.underlineProperty ()
Returns the underline property controlling whether an underline is rendered beneath the label text.
An AussomJavaObject around a BooleanProperty.setUnderline (bool Underline)
Sets whether an underline is drawn beneath the label text.
Underline is a bool; true draws the underline.this objectisUnderline ()
Returns whether the underline rendering is enabled.
A bool that is true when the text is underlined.lineSpacingProperty ()
Returns the lineSpacing property controlling extra space added between wrapped text lines.
An AussomJavaObject around a DoubleProperty.setLineSpacing (double LineSpacing)
Sets the additional space added between wrapped text lines.
LineSpacing is a double with the extra pixels added between lines.this objectgetLineSpacing ()
Returns the additional spacing currently inserted between wrapped lines.
A double with the configured line spacing in pixels.contentDisplayProperty ()
Returns the contentDisplay property that controls how the graphic is positioned relative to the text.
An AussomJavaObject around an ObjectPropertysetContentDisplay (object ContentDisplay)
Sets the position of the graphic relative to the text.
ContentDisplay is an AussomJavaObject around a javafx.scene.control.ContentDisplay value.this objectgetContentDisplay ()
Returns the current graphic position relative to the text.
An AussomJavaObject around a javafx.scene.control.ContentDisplay value.labelPaddingProperty ()
Returns the read-only labelPadding property describing extra padding applied around the label content inside the control bounds.
An AussomJavaObject around a ReadOnlyObjectPropertygetLabelPadding ()
Returns the current label padding Insets value.
An AussomJavaObject around a javafx.geometry.Insets value.graphicTextGapProperty ()
Returns the graphicTextGap property holding the pixel gap inserted between the graphic and the text.
An AussomJavaObject around a DoubleProperty.setGraphicTextGap (double GraphicTextGap)
Sets the pixel gap between the graphic and the text.
GraphicTextGap is a double with the gap in pixels.this objectgetGraphicTextGap ()
Returns the current pixel gap between the graphic and the text.
A double with the configured gap in pixels.setTextFill (object TextFill)
Sets the paint used to render the label text.
TextFill is an AussomJavaObject around a javafx.scene.paint.Paint value.this objectgetTextFill ()
Returns the paint currently used to render the label text.
An AussomJavaObject around a javafx.scene.paint.Paint value.textFillProperty ()
Returns the textFill property used to bind or observe the text paint.
An AussomJavaObject around an ObjectPropertysetMnemonicParsing (bool MnemonicParsing)
Sets whether mnemonic parsing is enabled. When true an underscore in the text marks the next character as a mnemonic accelerator.
MnemonicParsing is a bool; true enables parsing.this objectisMnemonicParsing ()
Returns whether mnemonic parsing is currently enabled.
A bool that is true when mnemonic parsing is active.mnemonicParsingProperty ()
Returns the mnemonicParsing property for binding or change listeners.
An AussomJavaObject around a BooleanProperty.getControlCssMetaData ()
Returns the CSS metadata describing this Labeled's styleable properties; used by the JavaFX CSS engine.
An AussomJavaObject around a List of CssMetaData entries.