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
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:
- 
Property SummaryPropertiesTypePropertyDescriptionfinal ObjectProperty<Pos>Specifies how the text and graphic within the Labeled should be aligned when there is empty space within the Labeled.final ObjectProperty<ContentDisplay>Specifies the positioning of the graphic relative to the text.final StringPropertySpecifies the string to display for the ellipsis when text is truncated.final ObjectProperty<Font>The default font to use for text in the Labeled.final ObjectProperty<Node>An optional icon for the Labeled.final DoublePropertyThe amount of space between the graphic and textfinal ReadOnlyObjectProperty<Insets>The padding around the Labeled's text and graphic content.final DoublePropertySpecifies the space in pixel between lines.final BooleanPropertyMnemonicParsing property to enable/disable text parsing.final ObjectProperty<TextAlignment>Specifies the behavior for lines of text when text is multiline.final ObjectProperty<Paint>ThePaintused to fill the text.final ObjectProperty<OverrunStyle>Specifies the behavior to use if the text of theLabeledexceeds the available space for rendering the text.final StringPropertyThe text to display in the label.final BooleanPropertyWhether all text should be underlined.final BooleanPropertyIf a run of text exceeds the width of the Labeled, then this variable indicates whether the text should wrap onto another line.Properties declared in class javafx.scene.control.ControlcontextMenu, skin, tooltipProperties declared in class javafx.scene.layout.Regionbackground, border, cacheShape, centerShape, height, insets, maxHeight, maxWidth, minHeight, minWidth, opaqueInsets, padding, prefHeight, prefWidth, scaleShape, shape, snapToPixel, widthProperties declared in class javafx.scene.ParentneedsLayoutProperties declared in class javafx.scene.NodeaccessibleHelp, accessibleRoleDescription, accessibleRole, accessibleText, blendMode, boundsInLocal, boundsInParent, cacheHint, cache, clip, cursor, depthTest, disabled, disable, effectiveNodeOrientation, effect, eventDispatcher, focused, focusTraversable, focusVisible, focusWithin, 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 SummaryFields declared in class javafx.scene.layout.RegionUSE_COMPUTED_SIZE, USE_PREF_SIZEFields declared in class javafx.scene.NodeBASELINE_OFFSET_SAME_AS_HEIGHT
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionfinal ObjectProperty<Pos>Specifies how the text and graphic within the Labeled should be aligned when there is empty space within the Labeled.final ObjectProperty<ContentDisplay>Specifies the positioning of the graphic relative to the text.final StringPropertySpecifies the string to display for the ellipsis when text is truncated.final ObjectProperty<Font>The default font to use for text in the Labeled.final PosGets the value of thealignmentproperty.static List<CssMetaData<? extends Styleable,?>> Gets theCssMetaDataassociated with this class, which may include theCssMetaDataof its superclasses.If wrapText is true, then contentBias will be HORIZONTAL, otherwise it is null.final ContentDisplayGets the value of thecontentDisplayproperty.List<CssMetaData<? extends Styleable,?>> Gets the unmodifiable list of the control's CSS-styleable properties.final StringGets the value of theellipsisStringproperty.final FontgetFont()Gets the value of thefontproperty.final NodeGets the value of thegraphicproperty.final doubleGets the value of thegraphicTextGapproperty.protected PosReturns the initial alignment state of this control, for use by the JavaFX CSS engine to correctly set its initial value.final InsetsGets the value of thelabelPaddingproperty.final doubleGets the value of thelineSpacingproperty.final StringgetText()Gets the value of thetextproperty.final TextAlignmentGets the value of thetextAlignmentproperty.final PaintGets the value of thetextFillproperty.final OverrunStyleGets the value of thetextOverrunproperty.final ObjectProperty<Node>An optional icon for the Labeled.final DoublePropertyThe amount of space between the graphic and textfinal booleanGets the value of themnemonicParsingproperty.final booleanGets the value of theunderlineproperty.final booleanGets the value of thewrapTextproperty.final ReadOnlyObjectProperty<Insets>The padding around the Labeled's text and graphic content.final DoublePropertySpecifies the space in pixel between lines.final BooleanPropertyMnemonicParsing property to enable/disable text parsing.final voidsetAlignment(Pos value) Sets the value of thealignmentproperty.final voidsetContentDisplay(ContentDisplay value) Sets the value of thecontentDisplayproperty.final voidsetEllipsisString(String value) Sets the value of theellipsisStringproperty.final voidSets the value of thefontproperty.final voidsetGraphic(Node value) Sets the value of thegraphicproperty.final voidsetGraphicTextGap(double value) Sets the value of thegraphicTextGapproperty.final voidsetLineSpacing(double value) Sets the value of thelineSpacingproperty.final voidsetMnemonicParsing(boolean value) Sets the value of themnemonicParsingproperty.final voidSets the value of thetextproperty.final voidsetTextAlignment(TextAlignment value) Sets the value of thetextAlignmentproperty.final voidsetTextFill(Paint value) Sets the value of thetextFillproperty.final voidsetTextOverrun(OverrunStyle value) Sets the value of thetextOverrunproperty.final voidsetUnderline(boolean value) Sets the value of theunderlineproperty.final voidsetWrapText(boolean value) Sets the value of thewrapTextproperty.final ObjectProperty<TextAlignment>Specifies the behavior for lines of text when text is multiline.final ObjectProperty<Paint>ThePaintused to fill the text.final ObjectProperty<OverrunStyle>Specifies the behavior to use if the text of theLabeledexceeds the available space for rendering the text.final StringPropertyThe text to display in the label.final BooleanPropertyWhether all text should be underlined.final BooleanPropertyIf a run of text exceeds the width of the Labeled, then this variable indicates whether the text should wrap onto another line.Methods declared in class javafx.scene.control.ControlcomputeMaxHeight, computeMaxWidth, computeMinHeight, computeMinWidth, contextMenuProperty, createDefaultSkin, getContextMenu, getCssMetaData, getInitialFocusTraversable, getSkin, getTooltip, isResizable, setContextMenu, setSkin, setTooltip, skinProperty, tooltipPropertyMethods declared in class javafx.scene.layout.RegionbackgroundProperty, borderProperty, cacheShapeProperty, centerShapeProperty, computePrefHeight, computePrefWidth, 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, widthPropertyMethods declared in class javafx.scene.ParentgetBaselineOffset, getChildren, getChildrenUnmodifiable, getManagedChildren, getStylesheets, isNeedsLayout, layout, layoutChildren, needsLayoutProperty, requestLayout, requestParentLayout, setNeedsLayout, updateBoundsMethods declared in class javafx.scene.NodeaccessibleHelpProperty, accessibleRoleDescriptionProperty, accessibleRoleProperty, accessibleTextProperty, addEventFilter, addEventHandler, applyCss, autosize, blendModeProperty, boundsInLocalProperty, boundsInParentProperty, buildEventDispatchChain, cacheHintProperty, cacheProperty, clipProperty, computeAreaInScreen, contains, contains, cursorProperty, depthTestProperty, disabledProperty, disableProperty, effectiveNodeOrientationProperty, effectProperty, eventDispatcherProperty, executeAccessibleAction, fireEvent, focusedProperty, focusTraversableProperty, focusVisibleProperty, focusWithinProperty, 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, isFocusVisible, isFocusWithin, 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, lookup, 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, queryAccessibleAttribute, 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, toString, translateXProperty, translateYProperty, translateZProperty, usesMirroring, viewOrderProperty, visiblePropertyMethods declared in class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods declared in interface javafx.css.StyleablegetStyleableNode
- 
Property Details- 
textThe text to display in the label. The text may be null.- Default value:
- empty string
- See Also:
 
- 
alignmentSpecifies how the text and graphic within the Labeled should be aligned when there is empty space within the Labeled.- Default value:
- Pos.CENTER_LEFT
- See Also:
 
- 
textAlignmentSpecifies the behavior for lines of text when text is multiline. UnlikecontentDisplayProperty()which affects the graphic and text, this setting only affects multiple lines of text relative to the text bounds.- Default value:
- TextAlignment.LEFT
- See Also:
 
- 
textOverrunSpecifies the behavior to use if the text of theLabeledexceeds the available space for rendering the text.- Default value:
- OverrunStyle.ELLIPSIS
- See Also:
 
- 
ellipsisStringSpecifies 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. - Default value:
- "..."
- Since:
- JavaFX 2.2
- See Also:
 
- 
wrapTextIf a run of text exceeds the width of the Labeled, then this variable indicates whether the text should wrap onto another line.- Default value:
- false
- See Also:
 
- 
fontThe 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.- Default value:
- Font.getDefault()
- See Also:
 
- 
graphicAn optional icon for the Labeled. This can be positioned relative to the text by usingsetContentDisplay(javafx.scene.control.ContentDisplay). The node specified for this variable cannot appear elsewhere in the scene graph, otherwise theIllegalArgumentExceptionis thrown. See the class description ofNodefor more detail.- Default value:
- null
- See Also:
 
- 
underlineWhether all text should be underlined.- Default value:
- false
- See Also:
 
- 
lineSpacingSpecifies the space in pixel between lines.- Default value:
- 0
- Since:
- JavaFX 8.0
- See Also:
 
- 
contentDisplaySpecifies the positioning of the graphic relative to the text.- Default value:
- ContentDisplay.LEFT
- See Also:
 
- 
labelPaddingThe 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.- Default value:
- Insets.EMPTY
- See Also:
 
- 
graphicTextGapThe amount of space between the graphic and text- Default value:
- 4
- See Also:
 
- 
textFillThePaintused to fill the text.- Default value:
- Color.BLACK
- See Also:
 
- 
mnemonicParsingMnemonicParsing 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.- Default value:
- false;- truefor some- Controls.
- See Also:
 
 
- 
- 
Constructor Details- 
Labeledpublic Labeled()Creates a Label with no text and graphic
- 
LabeledCreates a Label with text- Parameters:
- text- The text for the label.
 
- 
LabeledCreates a Label with text and a graphic- Parameters:
- text- The text for the label.
- graphic- The graphic for the label.
 
 
- 
- 
Method Details- 
textPropertyThe text to display in the label. The text may be null.- Default value:
- empty string
- Returns:
- the text to display in the label
- See Also:
 
- 
setTextSets the value of thetextproperty.- Property description:
- The text to display in the label. The text may be null.
- Default value:
- empty string
- Parameters:
- value- the value for the- textproperty
- See Also:
 
- 
getTextGets the value of thetextproperty.- Property description:
- The text to display in the label. The text may be null.
- Default value:
- empty string
- Returns:
- the value of the textproperty
- See Also:
 
- 
alignmentPropertySpecifies how the text and graphic within the Labeled should be aligned when there is empty space within the Labeled.- Default value:
- Pos.CENTER_LEFT
- Returns:
- the alignment within this labeled
- See Also:
 
- 
setAlignmentSets the value of thealignmentproperty.- Property description:
- Specifies how the text and graphic within the Labeled should be aligned when there is empty space within the Labeled.
- Default value:
- Pos.CENTER_LEFT
- Parameters:
- value- the value for the- alignmentproperty
- See Also:
 
- 
getAlignmentGets the value of thealignmentproperty.- Property description:
- Specifies how the text and graphic within the Labeled should be aligned when there is empty space within the Labeled.
- Default value:
- Pos.CENTER_LEFT
- Returns:
- the value of the alignmentproperty
- See Also:
 
- 
textAlignmentPropertySpecifies the behavior for lines of text when text is multiline. UnlikecontentDisplayProperty()which affects the graphic and text, this setting only affects multiple lines of text relative to the text bounds.- Default value:
- TextAlignment.LEFT
- Returns:
- the alignment of lines of text within this labeled
- See Also:
 
- 
setTextAlignmentSets the value of thetextAlignmentproperty.- 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.
- Default value:
- TextAlignment.LEFT
- Parameters:
- value- the value for the- textAlignmentproperty
- See Also:
 
- 
getTextAlignmentGets the value of thetextAlignmentproperty.- 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.
- Default value:
- TextAlignment.LEFT
- Returns:
- the value of the textAlignmentproperty
- See Also:
 
- 
textOverrunPropertySpecifies the behavior to use if the text of theLabeledexceeds the available space for rendering the text.- Default value:
- OverrunStyle.ELLIPSIS
- Returns:
- the overrun behavior if the text exceeds the available space
- See Also:
 
- 
setTextOverrunSets the value of thetextOverrunproperty.- Property description:
- Specifies the behavior to use if the text of the Labeledexceeds the available space for rendering the text.
- Default value:
- OverrunStyle.ELLIPSIS
- Parameters:
- value- the value for the- textOverrunproperty
- See Also:
 
- 
getTextOverrunGets the value of thetextOverrunproperty.- Property description:
- Specifies the behavior to use if the text of the Labeledexceeds the available space for rendering the text.
- Default value:
- OverrunStyle.ELLIPSIS
- Returns:
- the value of the textOverrunproperty
- See Also:
 
- 
ellipsisStringPropertySpecifies 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. - Default value:
- "..."
- Returns:
- the ellipsis property on the string to display for the ellipsis when text is truncated
- Since:
- JavaFX 2.2
- See Also:
 
- 
setEllipsisStringSets the value of theellipsisStringproperty.- 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. 
- Default value:
- "..."
- Parameters:
- value- the value for the- ellipsisStringproperty
- Since:
- JavaFX 2.2
- See Also:
 
- 
getEllipsisStringGets the value of theellipsisStringproperty.- 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. 
- Default value:
- "..."
- Returns:
- the value of the ellipsisStringproperty
- Since:
- JavaFX 2.2
- See Also:
 
- 
wrapTextPropertyIf a run of text exceeds the width of the Labeled, then this variable indicates whether the text should wrap onto another line.- Default value:
- false
- Returns:
- the wrap property if a run of text exceeds the width of the Labeled
- See Also:
 
- 
setWrapTextpublic final void setWrapText(boolean value) Sets the value of thewrapTextproperty.- 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.
- Default value:
- false
- Parameters:
- value- the value for the- wrapTextproperty
- See Also:
 
- 
isWrapTextpublic final boolean isWrapText()Gets the value of thewrapTextproperty.- 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.
- Default value:
- false
- Returns:
- the value of the wrapTextproperty
- See Also:
 
- 
getContentBiasIf wrapText is true, then contentBias will be HORIZONTAL, otherwise it is null.- Overrides:
- getContentBiasin class- Node
- Returns:
- orientation of width/height dependency or null if there is none
- See Also:
 
- 
fontPropertyThe 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.- Default value:
- Font.getDefault()
- Returns:
- the default font to use for text in this labeled
- See Also:
 
- 
setFontSets the value of thefontproperty.- 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.
- Default value:
- Font.getDefault()
- Parameters:
- value- the value for the- fontproperty
- See Also:
 
- 
getFontGets the value of thefontproperty.- 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.
- Default value:
- Font.getDefault()
- Returns:
- the value of the fontproperty
- See Also:
 
- 
graphicPropertyAn optional icon for the Labeled. This can be positioned relative to the text by usingsetContentDisplay(javafx.scene.control.ContentDisplay). The node specified for this variable cannot appear elsewhere in the scene graph, otherwise theIllegalArgumentExceptionis thrown. See the class description ofNodefor more detail.- Default value:
- null
- Returns:
- the optional icon for this labeled
- See Also:
 
- 
setGraphicSets the value of thegraphicproperty.- 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 theIllegalArgumentExceptionis thrown. See the class description ofNodefor more detail.
- Default value:
- null
- Parameters:
- value- the value for the- graphicproperty
- See Also:
 
- 
getGraphicGets the value of thegraphicproperty.- 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 theIllegalArgumentExceptionis thrown. See the class description ofNodefor more detail.
- Default value:
- null
- Returns:
- the value of the graphicproperty
- See Also:
 
- 
underlinePropertyWhether all text should be underlined.- Default value:
- false
- Returns:
- the underline property of all text in this labeled
- See Also:
 
- 
setUnderlinepublic final void setUnderline(boolean value) Sets the value of theunderlineproperty.- Property description:
- Whether all text should be underlined.
- Default value:
- false
- Parameters:
- value- the value for the- underlineproperty
- See Also:
 
- 
isUnderlinepublic final boolean isUnderline()Gets the value of theunderlineproperty.- Property description:
- Whether all text should be underlined.
- Default value:
- false
- Returns:
- the value of the underlineproperty
- See Also:
 
- 
lineSpacingPropertySpecifies the space in pixel between lines.- Default value:
- 0
- Returns:
- the line spacing property between lines in this labeled
- Since:
- JavaFX 8.0
- See Also:
 
- 
setLineSpacingpublic final void setLineSpacing(double value) Sets the value of thelineSpacingproperty.- Property description:
- Specifies the space in pixel between lines.
- Default value:
- 0
- Parameters:
- value- the value for the- lineSpacingproperty
- Since:
- JavaFX 8.0
- See Also:
 
- 
getLineSpacingpublic final double getLineSpacing()Gets the value of thelineSpacingproperty.- Property description:
- Specifies the space in pixel between lines.
- Default value:
- 0
- Returns:
- the value of the lineSpacingproperty
- Since:
- JavaFX 8.0
- See Also:
 
- 
contentDisplayPropertySpecifies the positioning of the graphic relative to the text.- Default value:
- ContentDisplay.LEFT
- Returns:
- content display property of this labeled
- See Also:
 
- 
setContentDisplaySets the value of thecontentDisplayproperty.- Property description:
- Specifies the positioning of the graphic relative to the text.
- Default value:
- ContentDisplay.LEFT
- Parameters:
- value- the value for the- contentDisplayproperty
- See Also:
 
- 
getContentDisplayGets the value of thecontentDisplayproperty.- Property description:
- Specifies the positioning of the graphic relative to the text.
- Default value:
- ContentDisplay.LEFT
- Returns:
- the value of the contentDisplayproperty
- See Also:
 
- 
labelPaddingPropertyThe 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.- Default value:
- Insets.EMPTY
- Returns:
- the label padding property of this labeled
- See Also:
 
- 
getLabelPaddingGets the value of thelabelPaddingproperty.- 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.
- Default value:
- Insets.EMPTY
- Returns:
- the value of the labelPaddingproperty
- See Also:
 
- 
graphicTextGapPropertyThe amount of space between the graphic and text- Default value:
- 4
- Returns:
- the graphics text gap property of this labeled
- See Also:
 
- 
setGraphicTextGappublic final void setGraphicTextGap(double value) Sets the value of thegraphicTextGapproperty.- Property description:
- The amount of space between the graphic and text
- Default value:
- 4
- Parameters:
- value- the value for the- graphicTextGapproperty
- See Also:
 
- 
getGraphicTextGappublic final double getGraphicTextGap()Gets the value of thegraphicTextGapproperty.- Property description:
- The amount of space between the graphic and text
- Default value:
- 4
- Returns:
- the value of the graphicTextGapproperty
- See Also:
 
- 
setTextFillSets the value of thetextFillproperty.- Property description:
- The Paintused to fill the text.
- Default value:
- Color.BLACK
- Parameters:
- value- the value for the- textFillproperty
- See Also:
 
- 
getTextFillGets the value of thetextFillproperty.- Property description:
- The Paintused to fill the text.
- Default value:
- Color.BLACK
- Returns:
- the value of the textFillproperty
- See Also:
 
- 
textFillPropertyThePaintused to fill the text.- Default value:
- Color.BLACK
- Returns:
- the textFillproperty
- See Also:
 
- 
setMnemonicParsingpublic final void setMnemonicParsing(boolean value) Sets the value of themnemonicParsingproperty.- 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.
- Default value:
- false;- truefor some- Controls.
- Parameters:
- value- the value for the- mnemonicParsingproperty
- See Also:
 
- 
isMnemonicParsingpublic final boolean isMnemonicParsing()Gets the value of themnemonicParsingproperty.- 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.
- Default value:
- false;- truefor some- Controls.
- Returns:
- the value of the mnemonicParsingproperty
- See Also:
 
- 
mnemonicParsingPropertyMnemonicParsing 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.- Default value:
- false;- truefor some- Controls.
- Returns:
- the mnemonicParsingproperty
- See Also:
 
- 
getInitialAlignmentReturns 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
 
- 
getClassCssMetaDataGets theCssMetaDataassociated with this class, which may include theCssMetaDataof its superclasses.- Returns:
- the CssMetaData
- Since:
- JavaFX 8.0
 
- 
getControlCssMetaDataGets the unmodifiable list of the control's CSS-styleable properties.- Overrides:
- getControlCssMetaDatain class- Control
- Returns:
- the unmodifiable list of the control's CSS-styleable properties
- Since:
- JavaFX 8.0
 
 
-