Module javafx.controls
Package javafx.scene.control

# Class Labeled

java.lang.Object
javafx.scene.Node
javafx.scene.Parent
javafx.scene.layout.Region
javafx.scene.control.Control
javafx.scene.control.Labeled

All Implemented Interfaces:
  `Styleable`, `EventTarget`, `Skinnable`

Direct Known Subclasses:
  `ButtonBase`, `Cell`, `Label`, `TitledPane`

@DefaultProperty("text") public abstract class Labeled extends Control
A Labeled `Control` is one which has as part of its user interface a textual content associated with it. For example, a `Button` displays `text`, as does a `Label`, a `Tooltip`, and many other controls.

Labeled is also a convenient base class from which to extend when building new Controls which, as part of their UI, display read-only textual content.

Example of how to place a graphic above the text:

      Image image = new Image(getClass().getResourceAsStream("image.png"));
      ImageView imageView = new ImageView();
      imageView.setImage(image);
      Label label = new Label("text", imageView);
      label.setContentDisplay(ContentDisplay.TOP);

Since:
  JavaFX 2.0
See Also:
  - `Button`
  - `Label`
  - `ToggleButton`

## Property Summary

Properties
Type
Property
Description
`final ObjectProperty<Pos>`
`alignment`
Specifies how the text and graphic within the Labeled should be aligned when there is empty space within the Labeled.
`final ObjectProperty<ContentDisplay>`
`contentDisplay`
Specifies the positioning of the graphic relative to the text.
`final StringProperty`
`ellipsisString`
Specifies the string to display for the ellipsis when text is truncated.
`final ObjectProperty<Font>`
`font`
The default font to use for text in the Labeled.
`final ObjectProperty<Node>`
`graphic`
An optional icon for the Labeled.
`final DoubleProperty`
`graphicTextGap`
The amount of space between the graphic and text
`final ReadOnlyObjectProperty<Insets>`
`labelPadding`
The padding around the Labeled's text and graphic content.
`final DoubleProperty`
`lineSpacing`
Specifies the space in pixel between lines.
`final BooleanProperty`
`mnemonicParsing`
MnemonicParsing property to enable/disable text parsing.
`final ObjectProperty<TextAlignment>`
`textAlignment`
Specifies the behavior for lines of text when text is multiline Unlike `contentDisplayProperty()` which affects the graphic and text, this setting only affects multiple lines of text relative to the text bounds.
`final ObjectProperty<Paint>`
`textFill`
The `Paint` used to fill the text.
`final ObjectProperty<OverrunStyle>`
`textOverrun`
Specifies the behavior to use if the text of the `Labeled` exceeds the available space for rendering the text.
`final StringProperty`
`text`
The text to display in the label.
`final BooleanProperty`
`underline`
Whether all text should be underlined.
`final BooleanProperty`
`wrapText`
If a run of text exceeds the width of the Labeled, then this variable indicates whether the text should wrap onto another line.

### Properties inherited from class javafx.scene.control.Control

`contextMenu, skin, tooltip`

### Properties inherited from class javafx.scene.layout.Region

`background, border, cacheShape, centerShape, height, insets, maxHeight, maxWidth, minHeight, minWidth, opaqueInsets, padding, prefHeight, prefWidth, scaleShape, shape, snapToPixel, width`

### Properties inherited from class javafx.scene.Parent

`needsLayout`

### Properties inherited from class javafx.scene.Node

`accessibleHelp, accessibleRoleDescription, accessibleRole, accessibleText, blendMode, boundsInLocal, boundsInParent, cacheHint, cache, clip, cursor, depthTest, disabled, disable, effectiveNodeOrientation, effect, eventDispatcher, focused, focusTraversable, hover, id, inputMethodRequests, layoutBounds, layoutX, layoutY, localToParentTransform, localToSceneTransform, managed, mouseTransparent, nodeOrientation, onContextMenuRequested, onDragDetected, onDragDone, onDragDropped, onDragEntered, onDragExited, onDragOver, onInputMethodTextChanged, onKeyPressed, onKeyReleased, onKeyTyped, onMouseClicked, onMouseDragEntered, onMouseDragExited, onMouseDragged, onMouseDragOver, onMouseDragReleased, onMouseEntered, onMouseExited, onMouseMoved, onMousePressed, onMouseReleased, onRotate, onRotationFinished, onRotationStarted, onScrollFinished, onScroll, onScrollStarted, onSwipeDown, onSwipeLeft, onSwipeRight, onSwipeUp, onTouchMoved, onTouchPressed, onTouchReleased, onTouchStationary, onZoomFinished, onZoom, onZoomStarted, opacity, parent, pickOnBounds, pressed, rotate, rotationAxis, scaleX, scaleY, scaleZ, scene, style, translateX, translateY, translateZ, viewOrder, visible`

## Field Summary

### Fields inherited from class javafx.scene.layout.Region

`USE_COMPUTED_SIZE, USE_PREF_SIZE`

### Fields inherited from class javafx.scene.Node

`BASELINE_OFFSET_SAME_AS_HEIGHT`

## Constructor Summary

Constructors
Constructor
Description
`Labeled()`
Creates a Label with no text and graphic
`Labeled(String text)`
Creates a Label with text
`Labeled(String text, Node graphic)`
Creates a Label with text and a graphic

## Method Summary

Modifier and Type
Method
Description
`final ObjectProperty<Pos>`
`alignmentProperty()`
Specifies how the text and graphic within the Labeled should be aligned when there is empty space within the Labeled.
`final ObjectProperty<ContentDisplay>`
`contentDisplayProperty()`
Specifies the positioning of the graphic relative to the text.
`final StringProperty`
`ellipsisStringProperty()`
Specifies the string to display for the ellipsis when text is truncated.
`final ObjectProperty<Font>`
`fontProperty()`
The default font to use for text in the Labeled.
`final Pos`
`getAlignment()`
Gets the value of the `alignment` property.
`static List<CssMetaData<? extends Styleable,?>>`
`getClassCssMetaData()`
`Orientation`
`getContentBias()`
If wrapText is true, then contentBias will be HORIZONTAL, otherwise it is null.
`final ContentDisplay`
`getContentDisplay()`
Gets the value of the `contentDisplay` property.
`List<CssMetaData<? extends Styleable,?>>`
`getControlCssMetaData()`
`final String`
`getEllipsisString()`
Gets the value of the `ellipsisString` property.
`final Font`
`getFont()`
Gets the value of the `font` property.
`final Node`
`getGraphic()`
Gets the value of the `graphic` property.
`final double`
`getGraphicTextGap()`
Gets the value of the `graphicTextGap` property.
`protected Pos`
`getInitialAlignment()`
Returns the initial alignment state of this control, for use by the JavaFX CSS engine to correctly set its initial value.
`final Insets`
`getLabelPadding()`
Gets the value of the `labelPadding` property.
`final double`
`getLineSpacing()`
Gets the value of the `lineSpacing` property.
`final String`
`getText()`
Gets the value of the `text` property.
`final TextAlignment`
`getTextAlignment()`
Gets the value of the `textAlignment` property.
`final Paint`
`getTextFill()`
Gets the value of the `textFill` property.
`final OverrunStyle`
`getTextOverrun()`
Gets the value of the `textOverrun` property.
`final ObjectProperty<Node>`
`graphicProperty()`
An optional icon for the Labeled.
`final DoubleProperty`
`graphicTextGapProperty()`
The amount of space between the graphic and text
`final boolean`
`isMnemonicParsing()`
Gets the value of the `mnemonicParsing` property.
`final boolean`
`isUnderline()`
Gets the value of the `underline` property.
`final boolean`
`isWrapText()`
Gets the value of the `wrapText` property.
`final ReadOnlyObjectProperty<Insets>`
`labelPaddingProperty()`
The padding around the Labeled's text and graphic content.
`final DoubleProperty`
`lineSpacingProperty()`
Specifies the space in pixel between lines.
`final BooleanProperty`
`mnemonicParsingProperty()`
MnemonicParsing property to enable/disable text parsing.
`final void`
`setAlignment(Pos value)`
Sets the value of the `alignment` property.
`final void`
`setContentDisplay(ContentDisplay value)`
Sets the value of the `contentDisplay` property.
`final void`
`setEllipsisString(String value)`
Sets the value of the `ellipsisString` property.
`final void`
`setFont(Font value)`
Sets the value of the `font` property.
`final void`
`setGraphic(Node value)`
Sets the value of the `graphic` property.
`final void`
`setGraphicTextGap(double value)`
Sets the value of the `graphicTextGap` property.
`final void`
`setLineSpacing(double value)`
Sets the value of the `lineSpacing` property.
`final void`
`setMnemonicParsing(boolean value)`
Sets the value of the `mnemonicParsing` property.
`final void`
`setText(String value)`
Sets the value of the `text` property.
`final void`
`setTextAlignment(TextAlignment value)`
Sets the value of the `textAlignment` property.
`final void`
`setTextFill(Paint value)`
Sets the value of the `textFill` property.
`final void`
`setTextOverrun(OverrunStyle value)`
Sets the value of the `textOverrun` property.
`final void`
`setUnderline(boolean value)`
Sets the value of the `underline` property.
`final void`
`setWrapText(boolean value)`
Sets the value of the `wrapText` property.
`final ObjectProperty<TextAlignment>`
`textAlignmentProperty()`
Specifies the behavior for lines of text when text is multiline Unlike `contentDisplayProperty()` which affects the graphic and text, this setting only affects multiple lines of text relative to the text bounds.
`final ObjectProperty<Paint>`
`textFillProperty()`
The `Paint` used to fill the text.
`final ObjectProperty<OverrunStyle>`
`textOverrunProperty()`
Specifies the behavior to use if the text of the `Labeled` exceeds the available space for rendering the text.
`final StringProperty`
`textProperty()`
The text to display in the label.
`String`
`toString()`
Returns a string representation for the object.
`final BooleanProperty`
`underlineProperty()`
Whether all text should be underlined.
`final BooleanProperty`
`wrapTextProperty()`
If a run of text exceeds the width of the Labeled, then this variable indicates whether the text should wrap onto another line.

### Methods inherited from class javafx.scene.control.Control

`computeMaxHeight, computeMaxWidth, computeMinHeight, computeMinWidth, computePrefHeight, computePrefWidth, contextMenuProperty, createDefaultSkin, executeAccessibleAction, getBaselineOffset, getContextMenu, getCssMetaData, getInitialFocusTraversable, getSkin, getTooltip, isResizable, layoutChildren, queryAccessibleAttribute, setContextMenu, setSkin, setTooltip, skinProperty, tooltipProperty`

### Methods inherited from class javafx.scene.layout.Region

`backgroundProperty, borderProperty, cacheShapeProperty, centerShapeProperty, getBackground, getBorder, getHeight, getInsets, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getOpaqueInsets, getPadding, getPrefHeight, getPrefWidth, getShape, getUserAgentStylesheet, getWidth, heightProperty, insetsProperty, isCacheShape, isCenterShape, isScaleShape, isSnapToPixel, layoutInArea, layoutInArea, layoutInArea, layoutInArea, maxHeight, maxHeightProperty, maxWidth, maxWidthProperty, minHeight, minHeightProperty, minWidth, minWidthProperty, opaqueInsetsProperty, paddingProperty, positionInArea, positionInArea, prefHeight, prefHeightProperty, prefWidth, prefWidthProperty, resize, scaleShapeProperty, setBackground, setBorder, setCacheShape, setCenterShape, setHeight, setMaxHeight, setMaxSize, setMaxWidth, setMinHeight, setMinSize, setMinWidth, setOpaqueInsets, setPadding, setPrefHeight, setPrefSize, setPrefWidth, setScaleShape, setShape, setSnapToPixel, setWidth, shapeProperty, snappedBottomInset, snappedLeftInset, snappedRightInset, snappedTopInset, snapPosition, snapPositionX, snapPositionY, snapSize, snapSizeX, snapSizeY, snapSpace, snapSpaceX, snapSpaceY, snapToPixelProperty, widthProperty`

### Methods inherited from class javafx.scene.Parent

`getChildren, getChildrenUnmodifiable, getManagedChildren, getStylesheets, isNeedsLayout, layout, lookup, needsLayoutProperty, requestLayout, requestParentLayout, setNeedsLayout, updateBounds`

### Methods inherited from class javafx.scene.Node

`accessibleHelpProperty, accessibleRoleDescriptionProperty, accessibleRoleProperty, accessibleTextProperty, addEventFilter, addEventHandler, applyCss, autosize, blendModeProperty, boundsInLocalProperty, boundsInParentProperty, buildEventDispatchChain, cacheHintProperty, cacheProperty, clipProperty, computeAreaInScreen, contains, contains, cursorProperty, depthTestProperty, disabledProperty, disableProperty, effectiveNodeOrientationProperty, effectProperty, eventDispatcherProperty, fireEvent, focusedProperty, focusTraversableProperty, getAccessibleHelp, getAccessibleRole, getAccessibleRoleDescription, getAccessibleText, getBlendMode, getBoundsInLocal, getBoundsInParent, getCacheHint, getClip, getCursor, getDepthTest, getEffect, getEffectiveNodeOrientation, getEventDispatcher, getId, getInitialCursor, getInputMethodRequests, getLayoutBounds, getLayoutX, getLayoutY, getLocalToParentTransform, getLocalToSceneTransform, getNodeOrientation, getOnContextMenuRequested, getOnDragDetected, getOnDragDone, getOnDragDropped, getOnDragEntered, getOnDragExited, getOnDragOver, getOnInputMethodTextChanged, getOnKeyPressed, getOnKeyReleased, getOnKeyTyped, getOnMouseClicked, getOnMouseDragEntered, getOnMouseDragExited, getOnMouseDragged, getOnMouseDragOver, getOnMouseDragReleased, getOnMouseEntered, getOnMouseExited, getOnMouseMoved, getOnMousePressed, getOnMouseReleased, getOnRotate, getOnRotationFinished, getOnRotationStarted, getOnScroll, getOnScrollFinished, getOnScrollStarted, getOnSwipeDown, getOnSwipeLeft, getOnSwipeRight, getOnSwipeUp, getOnTouchMoved, getOnTouchPressed, getOnTouchReleased, getOnTouchStationary, getOnZoom, getOnZoomFinished, getOnZoomStarted, getOpacity, getParent, getProperties, getPseudoClassStates, getRotate, getRotationAxis, getScaleX, getScaleY, getScaleZ, getScene, getStyle, getStyleableParent, getStyleClass, getTransforms, getTranslateX, getTranslateY, getTranslateZ, getTypeSelector, getUserData, getViewOrder, hasProperties, hoverProperty, idProperty, inputMethodRequestsProperty, intersects, intersects, isCache, isDisable, isDisabled, isFocused, isFocusTraversable, isHover, isManaged, isMouseTransparent, isPickOnBounds, isPressed, isVisible, layoutBoundsProperty, layoutXProperty, layoutYProperty, localToParent, localToParent, localToParent, localToParent, localToParent, localToParentTransformProperty, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToSceneTransformProperty, localToScreen, localToScreen, localToScreen, localToScreen, localToScreen, lookupAll, managedProperty, mouseTransparentProperty, nodeOrientationProperty, notifyAccessibleAttributeChanged, onContextMenuRequestedProperty, onDragDetectedProperty, onDragDoneProperty, onDragDroppedProperty, onDragEnteredProperty, onDragExitedProperty, onDragOverProperty, onInputMethodTextChangedProperty, onKeyPressedProperty, onKeyReleasedProperty, onKeyTypedProperty, onMouseClickedProperty, onMouseDragEnteredProperty, onMouseDragExitedProperty, onMouseDraggedProperty, onMouseDragOverProperty, onMouseDragReleasedProperty, onMouseEnteredProperty, onMouseExitedProperty, onMouseMovedProperty, onMousePressedProperty, onMouseReleasedProperty, onRotateProperty, onRotationFinishedProperty, onRotationStartedProperty, onScrollFinishedProperty, onScrollProperty, onScrollStartedProperty, onSwipeDownProperty, onSwipeLeftProperty, onSwipeRightProperty, onSwipeUpProperty, onTouchMovedProperty, onTouchPressedProperty, onTouchReleasedProperty, onTouchStationaryProperty, onZoomFinishedProperty, onZoomProperty, onZoomStartedProperty, opacityProperty, parentProperty, parentToLocal, parentToLocal, parentToLocal, parentToLocal, parentToLocal, pickOnBoundsProperty, pressedProperty, pseudoClassStateChanged, relocate, removeEventFilter, removeEventHandler, requestFocus, resizeRelocate, rotateProperty, rotationAxisProperty, scaleXProperty, scaleYProperty, scaleZProperty, sceneProperty, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, screenToLocal, screenToLocal, screenToLocal, setAccessibleHelp, setAccessibleRole, setAccessibleRoleDescription, setAccessibleText, setBlendMode, setCache, setCacheHint, setClip, setCursor, setDepthTest, setDisable, setDisabled, setEffect, setEventDispatcher, setEventHandler, setFocused, setFocusTraversable, setHover, setId, setInputMethodRequests, setLayoutX, setLayoutY, setManaged, setMouseTransparent, setNodeOrientation, setOnContextMenuRequested, setOnDragDetected, setOnDragDone, setOnDragDropped, setOnDragEntered, setOnDragExited, setOnDragOver, setOnInputMethodTextChanged, setOnKeyPressed, setOnKeyReleased, setOnKeyTyped, setOnMouseClicked, setOnMouseDragEntered, setOnMouseDragExited, setOnMouseDragged, setOnMouseDragOver, setOnMouseDragReleased, setOnMouseEntered, setOnMouseExited, setOnMouseMoved, setOnMousePressed, setOnMouseReleased, setOnRotate, setOnRotationFinished, setOnRotationStarted, setOnScroll, setOnScrollFinished, setOnScrollStarted, setOnSwipeDown, setOnSwipeLeft, setOnSwipeRight, setOnSwipeUp, setOnTouchMoved, setOnTouchPressed, setOnTouchReleased, setOnTouchStationary, setOnZoom, setOnZoomFinished, setOnZoomStarted, setOpacity, setPickOnBounds, setPressed, setRotate, setRotationAxis, setScaleX, setScaleY, setScaleZ, setStyle, setTranslateX, setTranslateY, setTranslateZ, setUserData, setViewOrder, setVisible, snapshot, snapshot, startDragAndDrop, startFullDrag, styleProperty, toBack, toFront, translateXProperty, translateYProperty, translateZProperty, usesMirroring, viewOrderProperty, visibleProperty`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Methods inherited from interface javafx.css.Styleable

`getStyleableNode`

## Property Details

### text

public final StringProperty textProperty
The text to display in the label. The text may be null.

See Also:
  - `getText()`
  - `setText(String)`
  - `textProperty()`

### alignment

public final ObjectProperty<Pos> alignmentProperty
Specifies how the text and graphic within the Labeled should be aligned when there is empty space within the Labeled.

See Also:
  - `getAlignment()`
  - `setAlignment(Pos)`
  - `alignmentProperty()`

### textAlignment

public final ObjectProperty<TextAlignment> textAlignmentProperty
Specifies the behavior for lines of text when text is multiline Unlike `contentDisplayProperty()` which affects the graphic and text, this setting only affects multiple lines of text relative to the text bounds.

See Also:
  - `getTextAlignment()`
  - `setTextAlignment(TextAlignment)`
  - `textAlignmentProperty()`

### textOverrun

public final ObjectProperty<OverrunStyle> textOverrunProperty
Specifies the behavior to use if the text of the `Labeled` exceeds the available space for rendering the text.

See Also:
  - `getTextOverrun()`
  - `setTextOverrun(OverrunStyle)`
  - `textOverrunProperty()`

### ellipsisString

public final StringProperty ellipsisStringProperty
Specifies the string to display for the ellipsis when text is truncated.

Ellipsis Table
Examples
"..." | Default value for most locales
" . . . " |
" [...] " |
"\u2026" | The Unicode ellipsis character '…'
"" | No ellipsis, just display the truncated string

Note that not all fonts support all Unicode characters.

Since:
  JavaFX 2.2
See Also:
  - `getEllipsisString()`
  - `setEllipsisString(String)`
  - `ellipsisStringProperty()`

### wrapText

public final BooleanProperty wrapTextProperty
If a run of text exceeds the width of the Labeled, then this variable indicates whether the text should wrap onto another line.

See Also:
  - `isWrapText()`
  - `setWrapText(boolean)`
  - `wrapTextProperty()`

### font

public final ObjectProperty<Font> fontProperty
The default font to use for text in the Labeled. If the Label's text is rich text then this font may or may not be used depending on the font information embedded in the rich text, but in any case where a default font is required, this font will be used.

See Also:
  - `getFont()`
  - `setFont(Font)`
  - `fontProperty()`

### graphic

public final ObjectProperty<Node> graphicProperty
An optional icon for the Labeled. This can be positioned relative to the text by using `setContentDisplay(javafx.scene.control.ContentDisplay)`. The node specified for this variable cannot appear elsewhere in the scene graph, otherwise the `IllegalArgumentException` is thrown. See the class description of `Node` for more detail.

See Also:
  - `getGraphic()`
  - `setGraphic(Node)`
  - `graphicProperty()`

### underline

public final BooleanProperty underlineProperty
Whether all text should be underlined.

See Also:
  - `isUnderline()`
  - `setUnderline(boolean)`
  - `underlineProperty()`

### lineSpacing

public final DoubleProperty lineSpacingProperty
Specifies the space in pixel between lines.

Since:
  JavaFX 8.0
See Also:
  - `getLineSpacing()`
  - `setLineSpacing(double)`
  - `lineSpacingProperty()`

### contentDisplay

public final ObjectProperty<ContentDisplay> contentDisplayProperty
Specifies the positioning of the graphic relative to the text.

See Also:
  - `getContentDisplay()`
  - `setContentDisplay(ContentDisplay)`
  - `contentDisplayProperty()`

### labelPadding

public final ReadOnlyObjectProperty<Insets> labelPaddingProperty
The padding around the Labeled's text and graphic content. By default labelPadding is Insets.EMPTY and cannot be set to null. Subclasses may add nodes outside this padding and inside the Labeled's padding. This property can only be set from CSS.

See Also:
  - `getLabelPadding()`
  - `labelPaddingProperty()`

### graphicTextGap

public final DoubleProperty graphicTextGapProperty
The amount of space between the graphic and text

See Also:
  - `getGraphicTextGap()`
  - `setGraphicTextGap(double)`
  - `graphicTextGapProperty()`

### textFill

public final ObjectProperty<Paint> textFillProperty
The `Paint` used to fill the text.

See Also:
  - `getTextFill()`
  - `setTextFill(Paint)`
  - `textFillProperty()`

### mnemonicParsing

public final BooleanProperty mnemonicParsingProperty
MnemonicParsing property to enable/disable text parsing. If this is set to true, then the Label text will be parsed to see if it contains the mnemonic parsing character '_'. When a mnemonic is detected the key combination will be determined based on the succeeding character, and the mnemonic added.

The default value for Labeled is false, but it is enabled by default on some Controls.

See Also:
  - `isMnemonicParsing()`
  - `setMnemonicParsing(boolean)`
  - `mnemonicParsingProperty()`

## Constructor Details

### Labeled

public Labeled()
Creates a Label with no text and graphic

### Labeled

public Labeled(String text)
Creates a Label with text

Parameters:
  `text` - The text for the label.

### Labeled

public Labeled(String text, Node graphic)
Creates a Label with text and a graphic

Parameters:
  `text` - The text for the label.
  `graphic` - The graphic for the label.

## Method Details

### textProperty

public final StringProperty textProperty()
The text to display in the label. The text may be null.

Returns:
  the text to display in the label
See Also:
  - `getText()`
  - `setText(String)`

### setText

public final void setText(String value)
Sets the value of the `text` property.

Property description:
  The text to display in the label. The text may be null.
Parameters:
  `value` - the value for the `text` property
See Also:
  - `getText()`
  - `textProperty()`

### getText

public final String getText()
Gets the value of the `text` property.

Property description:
  The text to display in the label. The text may be null.
Returns:
  the value of the `text` property
See Also:
  - `setText(String)`
  - `textProperty()`

### alignmentProperty

public final ObjectProperty<Pos> alignmentProperty()
Specifies how the text and graphic within the Labeled should be aligned when there is empty space within the Labeled.

Returns:
  the alignment within this labeled
See Also:
  - `getAlignment()`
  - `setAlignment(Pos)`

### setAlignment

public final void setAlignment(Pos value)
Sets the value of the `alignment` property.

Property description:
  Specifies how the text and graphic within the Labeled should be aligned when there is empty space within the Labeled.
Parameters:
  `value` - the value for the `alignment` property
See Also:
  - `getAlignment()`
  - `alignmentProperty()`

### getAlignment

public final Pos getAlignment()
Gets the value of the `alignment` property.

Property description:
  Specifies how the text and graphic within the Labeled should be aligned when there is empty space within the Labeled.
Returns:
  the value of the `alignment` property
See Also:
  - `setAlignment(Pos)`
  - `alignmentProperty()`

### textAlignmentProperty

public final ObjectProperty<TextAlignment> textAlignmentProperty()
Specifies the behavior for lines of text when text is multiline Unlike `contentDisplayProperty()` which affects the graphic and text, this setting only affects multiple lines of text relative to the text bounds.

Returns:
  the alignment of lines of text within this labeled
See Also:
  - `getTextAlignment()`
  - `setTextAlignment(TextAlignment)`

### setTextAlignment

public final void setTextAlignment(TextAlignment value)
Sets the value of the `textAlignment` property.

Property description:
  Specifies the behavior for lines of text when text is multiline Unlike `contentDisplayProperty()` which affects the graphic and text, this setting only affects multiple lines of text relative to the text bounds.
Parameters:
  `value` - the value for the `textAlignment` property
See Also:
  - `getTextAlignment()`
  - `textAlignmentProperty()`

### getTextAlignment

public final TextAlignment getTextAlignment()
Gets the value of the `textAlignment` property.

Property description:
  Specifies the behavior for lines of text when text is multiline Unlike `contentDisplayProperty()` which affects the graphic and text, this setting only affects multiple lines of text relative to the text bounds.
Returns:
  the value of the `textAlignment` property
See Also:
  - `setTextAlignment(TextAlignment)`
  - `textAlignmentProperty()`

### textOverrunProperty

public final ObjectProperty<OverrunStyle> textOverrunProperty()
Specifies the behavior to use if the text of the `Labeled` exceeds the available space for rendering the text.

Returns:
  the overrun behavior if the text exceeds the available space
See Also:
  - `getTextOverrun()`
  - `setTextOverrun(OverrunStyle)`

### setTextOverrun

public final void setTextOverrun(OverrunStyle value)
Sets the value of the `textOverrun` property.

Property description:
  Specifies the behavior to use if the text of the `Labeled` exceeds the available space for rendering the text.
Parameters:
  `value` - the value for the `textOverrun` property
See Also:
  - `getTextOverrun()`
  - `textOverrunProperty()`

### getTextOverrun

public final OverrunStyle getTextOverrun()
Gets the value of the `textOverrun` property.

Property description:
  Specifies the behavior to use if the text of the `Labeled` exceeds the available space for rendering the text.
Returns:
  the value of the `textOverrun` property
See Also:
  - `setTextOverrun(OverrunStyle)`
  - `textOverrunProperty()`

### ellipsisStringProperty

public final StringProperty ellipsisStringProperty()
Specifies the string to display for the ellipsis when text is truncated.

Ellipsis Table
Examples
"..." | Default value for most locales
" . . . " |
" [...] " |
"\u2026" | The Unicode ellipsis character '…'
"" | No ellipsis, just display the truncated string

Note that not all fonts support all Unicode characters.

Returns:
  the ellipsis property on the string to display for the ellipsis when text is truncated
Since:
  JavaFX 2.2
See Also:
  - `getEllipsisString()`
  - `setEllipsisString(String)`

### setEllipsisString

public final void setEllipsisString(String value)
Sets the value of the `ellipsisString` property.

Property description:
  Specifies the string to display for the ellipsis when text is truncated.

  Ellipsis Table
  Examples
  "..." | Default value for most locales
  " . . . " |
  " [...] " |
  "\u2026" | The Unicode ellipsis character '…'
  "" | No ellipsis, just display the truncated string

  Note that not all fonts support all Unicode characters.

Parameters:
  `value` - the value for the `ellipsisString` property
Since:
  JavaFX 2.2
See Also:
  - `getEllipsisString()`
  - `ellipsisStringProperty()`

### getEllipsisString

public final String getEllipsisString()
Gets the value of the `ellipsisString` property.

Property description:
  Specifies the string to display for the ellipsis when text is truncated.

  Ellipsis Table
  Examples
  "..." | Default value for most locales
  " . . . " |
  " [...] " |
  "\u2026" | The Unicode ellipsis character '…'
  "" | No ellipsis, just display the truncated string

  Note that not all fonts support all Unicode characters.

Returns:
  the value of the `ellipsisString` property
Since:
  JavaFX 2.2
See Also:
  - `setEllipsisString(String)`
  - `ellipsisStringProperty()`

### wrapTextProperty

public final BooleanProperty wrapTextProperty()
If a run of text exceeds the width of the Labeled, then this variable indicates whether the text should wrap onto another line.

Returns:
  the wrap property if a run of text exceeds the width of the Labeled
See Also:
  - `isWrapText()`
  - `setWrapText(boolean)`

### setWrapText

public final void setWrapText(boolean value)
Sets the value of the `wrapText` property.

Property description:
  If a run of text exceeds the width of the Labeled, then this variable indicates whether the text should wrap onto another line.
Parameters:
  `value` - the value for the `wrapText` property
See Also:
  - `isWrapText()`
  - `wrapTextProperty()`

### isWrapText

public final boolean isWrapText()
Gets the value of the `wrapText` property.

Property description:
  If a run of text exceeds the width of the Labeled, then this variable indicates whether the text should wrap onto another line.
Returns:
  the value of the `wrapText` property
See Also:
  - `setWrapText(boolean)`
  - `wrapTextProperty()`

### getContentBias

public Orientation getContentBias()
If wrapText is true, then contentBias will be HORIZONTAL, otherwise it is null.

Overrides:
  `getContentBias` in class `Node`
Returns:
  orientation of width/height dependency or null if there is none
See Also:
  - `Node.isResizable()`
  - `Node.minWidth(double)`
  - `Node.minHeight(double)`
  - `Node.prefWidth(double)`
  - `Node.prefHeight(double)`
  - `Node.maxWidth(double)`
  - `Node.maxHeight(double)`

### fontProperty

public final ObjectProperty<Font> fontProperty()
The default font to use for text in the Labeled. If the Label's text is rich text then this font may or may not be used depending on the font information embedded in the rich text, but in any case where a default font is required, this font will be used.

Returns:
  the default font to use for text in this labeled
See Also:
  - `getFont()`
  - `setFont(Font)`

### setFont

public final void setFont(Font value)
Sets the value of the `font` property.

Property description:
  The default font to use for text in the Labeled. If the Label's text is rich text then this font may or may not be used depending on the font information embedded in the rich text, but in any case where a default font is required, this font will be used.
Parameters:
  `value` - the value for the `font` property
See Also:
  - `getFont()`
  - `fontProperty()`

### getFont

public final Font getFont()
Gets the value of the `font` property.

Property description:
  The default font to use for text in the Labeled. If the Label's text is rich text then this font may or may not be used depending on the font information embedded in the rich text, but in any case where a default font is required, this font will be used.
Returns:
  the value of the `font` property
See Also:
  - `setFont(Font)`
  - `fontProperty()`

### graphicProperty

public final ObjectProperty<Node> graphicProperty()
An optional icon for the Labeled. This can be positioned relative to the text by using `setContentDisplay(javafx.scene.control.ContentDisplay)`. The node specified for this variable cannot appear elsewhere in the scene graph, otherwise the `IllegalArgumentException` is thrown. See the class description of `Node` for more detail.

Returns:
  the optional icon for this labeled
See Also:
  - `getGraphic()`
  - `setGraphic(Node)`

### setGraphic

public final void setGraphic(Node value)
Sets the value of the `graphic` property.

Property description:
  An optional icon for the Labeled. This can be positioned relative to the text by using `setContentDisplay(javafx.scene.control.ContentDisplay)`. The node specified for this variable cannot appear elsewhere in the scene graph, otherwise the `IllegalArgumentException` is thrown. See the class description of `Node` for more detail.
Parameters:
  `value` - the value for the `graphic` property
See Also:
  - `getGraphic()`
  - `graphicProperty()`

### getGraphic

public final Node getGraphic()
Gets the value of the `graphic` property.

Property description:
  An optional icon for the Labeled. This can be positioned relative to the text by using `setContentDisplay(javafx.scene.control.ContentDisplay)`. The node specified for this variable cannot appear elsewhere in the scene graph, otherwise the `IllegalArgumentException` is thrown. See the class description of `Node` for more detail.
Returns:
  the value of the `graphic` property
See Also:
  - `setGraphic(Node)`
  - `graphicProperty()`

### underlineProperty

public final BooleanProperty underlineProperty()
Whether all text should be underlined.

Returns:
  the underline property of all text in this labeled
See Also:
  - `isUnderline()`
  - `setUnderline(boolean)`

### setUnderline

public final void setUnderline(boolean value)
Sets the value of the `underline` property.

Property description:
  Whether all text should be underlined.
Parameters:
  `value` - the value for the `underline` property
See Also:
  - `isUnderline()`
  - `underlineProperty()`

### isUnderline

public final boolean isUnderline()
Gets the value of the `underline` property.

Property description:
  Whether all text should be underlined.
Returns:
  the value of the `underline` property
See Also:
  - `setUnderline(boolean)`
  - `underlineProperty()`

### lineSpacingProperty

public final DoubleProperty lineSpacingProperty()
Specifies the space in pixel between lines.

Returns:
  the line spacing property between lines in this labeled
Since:
  JavaFX 8.0
See Also:
  - `getLineSpacing()`
  - `setLineSpacing(double)`

### setLineSpacing

public final void setLineSpacing(double value)
Sets the value of the `lineSpacing` property.

Property description:
  Specifies the space in pixel between lines.
Parameters:
  `value` - the value for the `lineSpacing` property
Since:
  JavaFX 8.0
See Also:
  - `getLineSpacing()`
  - `lineSpacingProperty()`

### getLineSpacing

public final double getLineSpacing()
Gets the value of the `lineSpacing` property.

Property description:
  Specifies the space in pixel between lines.
Returns:
  the value of the `lineSpacing` property
Since:
  JavaFX 8.0
See Also:
  - `setLineSpacing(double)`
  - `lineSpacingProperty()`

### contentDisplayProperty

public final ObjectProperty<ContentDisplay> contentDisplayProperty()
Specifies the positioning of the graphic relative to the text.

Returns:
  content display property of this labeled
See Also:
  - `getContentDisplay()`
  - `setContentDisplay(ContentDisplay)`

### setContentDisplay

public final void setContentDisplay(ContentDisplay value)
Sets the value of the `contentDisplay` property.

Property description:
  Specifies the positioning of the graphic relative to the text.
Parameters:
  `value` - the value for the `contentDisplay` property
See Also:
  - `getContentDisplay()`
  - `contentDisplayProperty()`

### getContentDisplay

public final ContentDisplay getContentDisplay()
Gets the value of the `contentDisplay` property.

Property description:
  Specifies the positioning of the graphic relative to the text.
Returns:
  the value of the `contentDisplay` property
See Also:
  - `setContentDisplay(ContentDisplay)`
  - `contentDisplayProperty()`

### labelPaddingProperty

public final ReadOnlyObjectProperty<Insets> labelPaddingProperty()
The padding around the Labeled's text and graphic content. By default labelPadding is Insets.EMPTY and cannot be set to null. Subclasses may add nodes outside this padding and inside the Labeled's padding. This property can only be set from CSS.

Returns:
  the label padding property of this labeled
See Also:
  - `getLabelPadding()`

### getLabelPadding

public final Insets getLabelPadding()
Gets the value of the `labelPadding` property.

Property description:
  The padding around the Labeled's text and graphic content. By default labelPadding is Insets.EMPTY and cannot be set to null. Subclasses may add nodes outside this padding and inside the Labeled's padding. This property can only be set from CSS.
Returns:
  the value of the `labelPadding` property
See Also:
  - `labelPaddingProperty()`

### graphicTextGapProperty

public final DoubleProperty graphicTextGapProperty()
The amount of space between the graphic and text

Returns:
  the graphics text gap property of this labeled
See Also:
  - `getGraphicTextGap()`
  - `setGraphicTextGap(double)`

### setGraphicTextGap

public final void setGraphicTextGap(double value)
Sets the value of the `graphicTextGap` property.

Property description:
  The amount of space between the graphic and text
Parameters:
  `value` - the value for the `graphicTextGap` property
See Also:
  - `getGraphicTextGap()`
  - `graphicTextGapProperty()`

### getGraphicTextGap

public final double getGraphicTextGap()
Gets the value of the `graphicTextGap` property.

Property description:
  The amount of space between the graphic and text
Returns:
  the value of the `graphicTextGap` property
See Also:
  - `setGraphicTextGap(double)`
  - `graphicTextGapProperty()`

### setTextFill

public final void setTextFill(Paint value)
Sets the value of the `textFill` property.

Property description:
  The `Paint` used to fill the text.
Parameters:
  `value` - the value for the `textFill` property
See Also:
  - `getTextFill()`
  - `textFillProperty()`

### getTextFill

public final Paint getTextFill()
Gets the value of the `textFill` property.

Property description:
  The `Paint` used to fill the text.
Returns:
  the value of the `textFill` property
See Also:
  - `setTextFill(Paint)`
  - `textFillProperty()`

### textFillProperty

public final ObjectProperty<Paint> textFillProperty()
The `Paint` used to fill the text.

Returns:
  the `textFill` property
See Also:
  - `getTextFill()`
  - `setTextFill(Paint)`

### setMnemonicParsing

public final void setMnemonicParsing(boolean value)
Sets the value of the `mnemonicParsing` property.

Property description:
  MnemonicParsing property to enable/disable text parsing. If this is set to true, then the Label text will be parsed to see if it contains the mnemonic parsing character '_'. When a mnemonic is detected the key combination will be determined based on the succeeding character, and the mnemonic added.

  The default value for Labeled is false, but it is enabled by default on some Controls.

Parameters:
  `value` - the value for the `mnemonicParsing` property
See Also:
  - `isMnemonicParsing()`
  - `mnemonicParsingProperty()`

### isMnemonicParsing

public final boolean isMnemonicParsing()
Gets the value of the `mnemonicParsing` property.

Property description:
  MnemonicParsing property to enable/disable text parsing. If this is set to true, then the Label text will be parsed to see if it contains the mnemonic parsing character '_'. When a mnemonic is detected the key combination will be determined based on the succeeding character, and the mnemonic added.

  The default value for Labeled is false, but it is enabled by default on some Controls.

Returns:
  the value of the `mnemonicParsing` property
See Also:
  - `setMnemonicParsing(boolean)`
  - `mnemonicParsingProperty()`

### mnemonicParsingProperty

public final BooleanProperty mnemonicParsingProperty()
MnemonicParsing property to enable/disable text parsing. If this is set to true, then the Label text will be parsed to see if it contains the mnemonic parsing character '_'. When a mnemonic is detected the key combination will be determined based on the succeeding character, and the mnemonic added.

The default value for Labeled is false, but it is enabled by default on some Controls.

Returns:
  the `mnemonicParsing` property
See Also:
  - `isMnemonicParsing()`
  - `setMnemonicParsing(boolean)`

### toString

public String toString()
Description copied from class: `Node`
Returns a string representation for the object.

Overrides:
  `toString` in class `Node`
Returns:
  a string representation for the object.

### getInitialAlignment

protected Pos getInitialAlignment()
Returns the initial alignment state of this control, for use by the JavaFX CSS engine to correctly set its initial value. This method is overridden to use Pos.CENTER_LEFT initially.

Returns:
  the initial alignment state of this control
Since:
  9

### getClassCssMetaData

public static List<CssMetaData<? extends Styleable,?>> getClassCssMetaData()

Returns:
  The CssMetaData associated with this class, which may include the CssMetaData of its superclasses.
Since:
  JavaFX 8.0

### getControlCssMetaData

public List<CssMetaData<? extends Styleable,?>> getControlCssMetaData()

Overrides:
  `getControlCssMetaData` in class `Control`
Returns:
  unmodifiable list of the controls css styleable properties
Since:
  JavaFX 8.0