Class Tooltip
java.lang.Object
javafx.stage.Window
javafx.stage.PopupWindow
javafx.scene.control.PopupControl
javafx.scene.control.Tooltip
- All Implemented Interfaces:
Styleable, EventTarget, Skinnable
Tooltips are common UI elements which are typically used for showing
additional information about a Node in the scenegraph when the Node is
hovered over by the mouse. Any Node can show a tooltip. In most cases a
Tooltip is created and its 
text property is modified
to show plain text to the user. However, a Tooltip is able to show within it
an arbitrary scenegraph of nodes - this is done by creating the scenegraph
and setting it inside the Tooltip graphic
property.
You use the following approach to set a Tooltip on any node:
Rectangle rect = new Rectangle(0, 0, 100, 100);
Tooltip t = new Tooltip("A Square");
Tooltip.install(rect, t);
This tooltip will then participate with the typical tooltip semantics (i.e.
appearing on hover, etc). Note that the Tooltip does not have to be
uninstalled: it will be garbage collected when it is not referenced by any
Node. It is possible to manually uninstall the tooltip, however.
A single tooltip can be installed on multiple target nodes or multiple controls.
Because most Tooltips are shown on UI controls, there is special API for all controls to make installing a Tooltip less verbose. The example below shows how to create a tooltip for a Button control:
Button button = new Button("Hover Over Me");
button.setTooltip(new Tooltip("Tooltip for Button"));

- Since:
- JavaFX 2.0
-
Nested Class Summary
Nested classes/interfaces declared in class PopupWindow
PopupWindow.AnchorLocationModifier and TypeClassDescriptionstatic enumAnchor location constants for popup anchor point selection. -
Property Summary
PropertiesTypePropertyDescriptionfinal ReadOnlyBooleanPropertyTypically, the tooltip is "activated" when the mouse moves over a Control.final ObjectProperty<ContentDisplay> Specifies the positioning of the graphic relative to the text.final ObjectProperty<Font> The default font to use for text in the Tooltip.final ObjectProperty<Node> An optional icon for the Tooltip.final DoublePropertyThe amount of space between the graphic and textfinal ObjectProperty<Duration> The duration in which to continue showing the tooltip after the mouse has left the node.final ObjectProperty<Duration> The delay between the mouse entering the hovered node and when the associated tooltip will be shown to the user.final ObjectProperty<Duration> The duration that the tooltip should remain showing for until it is no longer visible to the user.final ObjectProperty<TextAlignment> Specifies the behavior for lines of text when text is multiline.final ObjectProperty<OverrunStyle> Specifies the behavior to use if the text of theTooltipexceeds the available space for rendering the text.final StringPropertyThe text to display in the tooltip.final BooleanPropertyIf a run of text exceeds the width of the Tooltip, then this variable indicates whether the text should wrap onto another line.Properties declared in class PopupControl
id, maxHeight, maxWidth, minHeight, minWidth, prefHeight, prefWidth, skin, styleTypePropertyDescriptionfinal StringPropertyThe id of thisPopupControl.final DoublePropertyProperty for overriding the control's computed maximum height.final DoublePropertyProperty for overriding the control's computed maximum width.final DoublePropertyProperty for overriding the control's computed minimum height.final DoublePropertyProperty for overriding the control's computed minimum width.final DoublePropertyProperty for overriding the control's computed preferred height.final DoublePropertyProperty for overriding the control's computed preferred width.final ObjectProperty<Skin<?>> Skin is responsible for rendering thisPopupControl.final StringPropertyA string representation of the CSS style associated with this specificPopupControl.Properties declared in class PopupWindow
anchorLocation, anchorX, anchorY, autoFix, autoHide, consumeAutoHidingEvents, hideOnEscape, onAutoHide, ownerNode, ownerWindowTypePropertyDescriptionSpecifies the popup anchor point which is used in popup positioning.final ReadOnlyDoublePropertySpecifies the x coordinate of the popup anchor point on the screen.final ReadOnlyDoublePropertySpecifies the y coordinate of the popup anchor point on the screen.final BooleanPropertyThis convenience variable indicates whether, when the popup is shown, it should automatically correct its position such that it doesn't end up positioned off the screen.final BooleanPropertySpecifies whether Popups should auto hide.final BooleanPropertySpecifies whether the event, which caused the Popup to hide, should be consumed.final BooleanPropertySpecifies whether the PopupWindow should be hidden when an unhandled escape key is pressed while the popup has focus.final ObjectProperty<EventHandler<Event>> Called after autoHide is run.final ReadOnlyObjectProperty<Node> The node which is the owner of this popup.final ReadOnlyObjectProperty<Window> The window which is the parent of this popup.Properties declared in class Window
eventDispatcher, focused, forceIntegerRenderScale, height, onCloseRequest, onHidden, onHiding, onShowing, onShown, opacity, outputScaleX, outputScaleY, renderScaleX, renderScaleY, scene, showing, width, x, yTypePropertyDescriptionfinal ObjectProperty<EventDispatcher> Specifies the event dispatcher for this node.final ReadOnlyBooleanPropertyWhether or not thisWindowhas the keyboard or input focus.final BooleanPropertyBoolean property that controls whether only integer render scales are set by default by the system when there is a change in the associated output scale.final ReadOnlyDoublePropertyThe height of thisWindow.final ObjectProperty<EventHandler<WindowEvent>> Called when there is an external request to close thisWindow.final ObjectProperty<EventHandler<WindowEvent>> Called just after the Window has been hidden.final ObjectProperty<EventHandler<WindowEvent>> Called just prior to the Window being hidden.final ObjectProperty<EventHandler<WindowEvent>> Called just prior to the Window being shown.final ObjectProperty<EventHandler<WindowEvent>> Called just after the Window is shown.final DoublePropertyDefines the opacity of theWindowas a value between 0.0 and 1.0.final ReadOnlyDoublePropertyThe scale that theWindowwill apply to horizontal scene coordinates in all stages of rendering and compositing the output to the screen or other destination device.final ReadOnlyDoublePropertyThe scale that theWindowwill apply to vertical scene coordinates in all stages of rendering and compositing the output to the screen or other destination device.final DoublePropertyThe horizontal scale that theWindowwill use when rendering itsSceneto the rendering buffer.final DoublePropertyThe vertical scale that theWindowwill use when rendering itsSceneto the rendering buffer.final ReadOnlyObjectProperty<Scene> TheSceneto be rendered on thisWindow.final ReadOnlyBooleanPropertyWhether or not thisWindowis showing (that is, open on the user's system).final ReadOnlyDoublePropertyThe width of thisWindow.final ReadOnlyDoublePropertyThe horizontal location of thisWindowon the screen.final ReadOnlyDoublePropertyThe vertical location of thisWindowon the screen. -
Field Summary
Fields declared in class PopupControl
bridge, USE_COMPUTED_SIZE, USE_PREF_SIZEModifier and TypeFieldDescriptionprotected PopupControl.CSSBridgeWe need a special root node, except we can't replace the special root node already in the PopupControl.static final doubleSentinel value which can be passed to a control's setMinWidth(), setMinHeight(), setPrefWidth(), setPrefHeight(), setMaxWidth(), setMaxHeight() methods to reset the control's size constraint back to it's intrinsic size returned by computeMinWidth(), computeMinHeight(), computePrefWidth(), computePrefHeight(), computeMaxWidth(), or computeMaxHeight().static final doubleSentinel value which can be passed to a control's setMinWidth(), setMinHeight(), setMaxWidth() or setMaxHeight() methods to indicate that the preferred dimension should be used for that max and/or min constraint. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal ReadOnlyBooleanPropertyTypically, the tooltip is "activated" when the mouse moves over a Control.final ObjectProperty<ContentDisplay> Specifies the positioning of the graphic relative to the text.final ObjectProperty<Font> The default font to use for text in the Tooltip.static List<CssMetaData<? extends Styleable, ?>> Gets theCssMetaDataassociated with this class, which may include theCssMetaDataof its superclasses.final ContentDisplayGets the value of thecontentDisplayproperty.List<CssMetaData<? extends Styleable, ?>> The CssMetaData of this Styleable.final FontgetFont()Gets the value of thefontproperty.final NodeGets the value of thegraphicproperty.final doubleGets the value of thegraphicTextGapproperty.final DurationGets the value of thehideDelayproperty.final DurationGets the value of theshowDelayproperty.final DurationGets the value of theshowDurationproperty.final StringgetText()Gets the value of thetextproperty.final TextAlignmentGets the value of thetextAlignmentproperty.final OverrunStyleGets the value of thetextOverrunproperty.final ObjectProperty<Node> An optional icon for the Tooltip.final DoublePropertyThe amount of space between the graphic and textfinal ObjectProperty<Duration> The duration in which to continue showing the tooltip after the mouse has left the node.static voidfinal booleanGets the value of theactivatedproperty.final booleanGets the value of thewrapTextproperty.final voidsetContentDisplay(ContentDisplay value) Sets the value of thecontentDisplayproperty.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 voidsetHideDelay(Duration hideDelay) Sets the value of thehideDelayproperty.final voidsetShowDelay(Duration showDelay) Sets the value of theshowDelayproperty.final voidsetShowDuration(Duration showDuration) Sets the value of theshowDurationproperty.final voidSets the value of thetextproperty.final voidsetTextAlignment(TextAlignment value) Sets the value of thetextAlignmentproperty.final voidsetTextOverrun(OverrunStyle value) Sets the value of thetextOverrunproperty.final voidsetWrapText(boolean value) Sets the value of thewrapTextproperty.final ObjectProperty<Duration> The delay between the mouse entering the hovered node and when the associated tooltip will be shown to the user.final ObjectProperty<Duration> The duration that the tooltip should remain showing for until it is no longer visible to the user.final ObjectProperty<TextAlignment> Specifies the behavior for lines of text when text is multiline.final ObjectProperty<OverrunStyle> Specifies the behavior to use if the text of theTooltipexceeds the available space for rendering the text.final StringPropertyThe text to display in the tooltip.static voidfinal BooleanPropertyIf a run of text exceeds the width of the Tooltip, then this variable indicates whether the text should wrap onto another line.Methods declared in class PopupControl
createDefaultSkin, getId, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getPrefHeight, getPrefWidth, getPseudoClassStates, getSkin, getStyle, getStyleableParent, getStyleClass, getTypeSelector, idProperty, maxHeight, maxHeightProperty, maxWidth, maxWidthProperty, minHeight, minHeightProperty, minWidth, minWidthProperty, prefHeight, prefHeightProperty, prefWidth, prefWidthProperty, pseudoClassStateChanged, setId, setMaxHeight, setMaxSize, setMaxWidth, setMinHeight, setMinSize, setMinWidth, setPrefHeight, setPrefSize, setPrefWidth, setSkin, setStyle, skinProperty, stylePropertyModifier and TypeMethodDescriptionprotected Skin<?> Create a new instance of the default skin for this control.final StringgetId()The id of thisPopupControl.final doubleProperty for overriding the control's computed maximum height.final doubleProperty for overriding the control's computed maximum width.final doubleProperty for overriding the control's computed minimum height.final doubleProperty for overriding the control's computed minimum width.final doubleProperty for overriding the control's computed preferred height.final doubleProperty for overriding the control's computed preferred width.final ObservableSet<PseudoClass> Return the pseudo-class state of this Styleable.final Skin<?> getSkin()Gets the value of theskinproperty.final StringgetStyle()Gets the value of thestyleproperty.Return the parent of this Styleable, or null if there is no parent.final ObservableList<String> Returns the list of String identifiers that make up the styleClass for this PopupControl.The type of thisStyleablethat is to be used in selector matching.final StringPropertyThe id of thisPopupControl.final doublemaxHeight(double width) Called during layout to determine the maximum height for this node.final DoublePropertyProperty for overriding the control's computed maximum height.final doublemaxWidth(double height) Called during layout to determine the maximum width for this node.final DoublePropertyProperty for overriding the control's computed maximum width.final doubleminHeight(double width) Called during layout to determine the minimum height for this node.final DoublePropertyProperty for overriding the control's computed minimum height.final doubleminWidth(double height) Called during layout to determine the minimum width for this node.final DoublePropertyProperty for overriding the control's computed minimum width.final doubleprefHeight(double width) Called during layout to determine the preferred height for this node.final DoublePropertyProperty for overriding the control's computed preferred height.final doubleprefWidth(double height) Called during layout to determine the preferred width for this node.final DoublePropertyProperty for overriding the control's computed preferred width.final voidpseudoClassStateChanged(PseudoClass pseudoClass, boolean active) Used to specify that a pseudo-class of this node has changed.final voidSets the id of thisPopupControl.final voidsetMaxHeight(double value) Property for overriding the control's computed maximum height.voidsetMaxSize(double maxWidth, double maxHeight) Convenience method for overriding the control's computed maximum width and height.final voidsetMaxWidth(double value) Property for overriding the control's computed maximum width.final voidsetMinHeight(double value) Property for overriding the control's computed minimum height.voidsetMinSize(double minWidth, double minHeight) Convenience method for overriding the control's computed minimum width and height.final voidsetMinWidth(double value) Property for overriding the control's computed minimum width.final voidsetPrefHeight(double value) Property for overriding the control's computed preferred height.voidsetPrefSize(double prefWidth, double prefHeight) Convenience method for overriding the control's computed preferred width and height.final voidsetPrefWidth(double value) Property for overriding the control's computed preferred width.final voidSets the value of theskinproperty.final voidSets the value of thestyleproperty.final ObjectProperty<Skin<?>> Skin is responsible for rendering thisPopupControl.final StringPropertyA string representation of the CSS style associated with this specificPopupControl.Methods declared in class PopupWindow
anchorLocationProperty, anchorXProperty, anchorYProperty, autoFixProperty, autoHideProperty, consumeAutoHidingEventsProperty, getAnchorLocation, getAnchorX, getAnchorY, getConsumeAutoHidingEvents, getOnAutoHide, getOwnerNode, getOwnerWindow, hide, hideOnEscapeProperty, isAutoFix, isAutoHide, isHideOnEscape, onAutoHideProperty, ownerNodeProperty, ownerWindowProperty, setAnchorLocation, setAnchorX, setAnchorY, setAutoFix, setAutoHide, setConsumeAutoHidingEvents, setHideOnEscape, setOnAutoHide, setScene, show, show, showModifier and TypeMethodDescriptionSpecifies the popup anchor point which is used in popup positioning.final ReadOnlyDoublePropertySpecifies the x coordinate of the popup anchor point on the screen.final ReadOnlyDoublePropertySpecifies the y coordinate of the popup anchor point on the screen.final BooleanPropertyThis convenience variable indicates whether, when the popup is shown, it should automatically correct its position such that it doesn't end up positioned off the screen.final BooleanPropertySpecifies whether Popups should auto hide.final BooleanPropertySpecifies whether the event, which caused the Popup to hide, should be consumed.Gets the value of theanchorLocationproperty.final doubleGets the value of theanchorXproperty.final doubleGets the value of theanchorYproperty.final booleanGets the value of theconsumeAutoHidingEventsproperty.final EventHandler<Event> Gets the value of theonAutoHideproperty.final NodeGets the value of theownerNodeproperty.final WindowGets the value of theownerWindowproperty.voidhide()Hide this Popup and all its childrenfinal BooleanPropertySpecifies whether the PopupWindow should be hidden when an unhandled escape key is pressed while the popup has focus.final booleanGets the value of theautoFixproperty.final booleanGets the value of theautoHideproperty.final booleanGets the value of thehideOnEscapeproperty.final ObjectProperty<EventHandler<Event>> Called after autoHide is run.final ReadOnlyObjectProperty<Node> The node which is the owner of this popup.final ReadOnlyObjectProperty<Window> The window which is the parent of this popup.final voidSets the value of theanchorLocationproperty.final voidsetAnchorX(double value) Sets the value of theanchorXproperty.final voidsetAnchorY(double value) Sets the value of theanchorYproperty.final voidsetAutoFix(boolean value) Sets the value of theautoFixproperty.final voidsetAutoHide(boolean value) Sets the value of theautoHideproperty.final voidsetConsumeAutoHidingEvents(boolean value) Sets the value of theconsumeAutoHidingEventsproperty.final voidsetHideOnEscape(boolean value) Sets the value of thehideOnEscapeproperty.final voidsetOnAutoHide(EventHandler<Event> value) Sets the value of theonAutoHideproperty.protected final voidNote to subclasses: the scene used by PopupWindow is very specifically managed by PopupWindow.voidShows the popup at the specified location on the screen.voidShow the popup.voidShows the popup at the specified location on the screen.Methods declared in class Window
addEventFilter, addEventHandler, buildEventDispatchChain, centerOnScreen, eventDispatcherProperty, fireEvent, focusedProperty, forceIntegerRenderScaleProperty, getEventDispatcher, getHeight, getOnCloseRequest, getOnHidden, getOnHiding, getOnShowing, getOnShown, getOpacity, getOutputScaleX, getOutputScaleY, getProperties, getRenderScaleX, getRenderScaleY, getScene, getUserData, getWidth, getWindows, getX, getY, hasProperties, heightProperty, isFocused, isForceIntegerRenderScale, isShowing, onCloseRequestProperty, onHiddenProperty, onHidingProperty, onShowingProperty, onShownProperty, opacityProperty, outputScaleXProperty, outputScaleYProperty, removeEventFilter, removeEventHandler, renderScaleXProperty, renderScaleYProperty, requestFocus, sceneProperty, setEventDispatcher, setEventHandler, setForceIntegerRenderScale, setHeight, setOnCloseRequest, setOnHidden, setOnHiding, setOnShowing, setOnShown, setOpacity, setRenderScaleX, setRenderScaleY, setUserData, setWidth, setX, setY, show, showingProperty, sizeToScene, widthProperty, xProperty, yPropertyModifier and TypeMethodDescriptionfinal <T extends Event>
voidaddEventFilter(EventType<T> eventType, EventHandler<? super T> eventFilter) Registers an event filter for this target.final <T extends Event>
voidaddEventHandler(EventType<T> eventType, EventHandler<? super T> eventHandler) Registers an event handler for this target.Construct an event dispatch chain for this target.voidSets x and y properties on this Window so that it is centered on the current screen.final ObjectProperty<EventDispatcher> Specifies the event dispatcher for this node.final voidFires the specified event.final ReadOnlyBooleanPropertyWhether or not thisWindowhas the keyboard or input focus.final BooleanPropertyBoolean property that controls whether only integer render scales are set by default by the system when there is a change in the associated output scale.final EventDispatcherGets the value of theeventDispatcherproperty.final doubleGets the value of theheightproperty.final EventHandler<WindowEvent> Gets the value of theonCloseRequestproperty.final EventHandler<WindowEvent> Gets the value of theonHiddenproperty.final EventHandler<WindowEvent> Gets the value of theonHidingproperty.final EventHandler<WindowEvent> Gets the value of theonShowingproperty.final EventHandler<WindowEvent> Gets the value of theonShownproperty.final doubleGets the value of theopacityproperty.final doubleGets the value of theoutputScaleXproperty.final doubleGets the value of theoutputScaleYproperty.final ObservableMap<Object, Object> Returns an observable map of properties on this node for use primarily by application developers.final doubleGets the value of therenderScaleXproperty.final doubleGets the value of therenderScaleYproperty.final ScenegetScene()Gets the value of thesceneproperty.Returns a previously set Object property, or null if no such property has been set using theWindow.setUserData(java.lang.Object)method.final doublegetWidth()Gets the value of thewidthproperty.static ObservableList<Window> Returns a list containing a reference to the currently showing JavaFX windows.final doublegetX()Gets the value of thexproperty.final doublegetY()Gets the value of theyproperty.booleanTests if Window has properties.final ReadOnlyDoublePropertyThe height of thisWindow.final booleanGets the value of thefocusedproperty.final booleanGets the value of theforceIntegerRenderScaleproperty.final booleanGets the value of theshowingproperty.final ObjectProperty<EventHandler<WindowEvent>> Called when there is an external request to close thisWindow.final ObjectProperty<EventHandler<WindowEvent>> Called just after the Window has been hidden.final ObjectProperty<EventHandler<WindowEvent>> Called just prior to the Window being hidden.final ObjectProperty<EventHandler<WindowEvent>> Called just prior to the Window being shown.final ObjectProperty<EventHandler<WindowEvent>> Called just after the Window is shown.final DoublePropertyDefines the opacity of theWindowas a value between 0.0 and 1.0.final ReadOnlyDoublePropertyThe scale that theWindowwill apply to horizontal scene coordinates in all stages of rendering and compositing the output to the screen or other destination device.final ReadOnlyDoublePropertyThe scale that theWindowwill apply to vertical scene coordinates in all stages of rendering and compositing the output to the screen or other destination device.final <T extends Event>
voidremoveEventFilter(EventType<T> eventType, EventHandler<? super T> eventFilter) Unregisters a previously registered event filter from this target.final <T extends Event>
voidremoveEventHandler(EventType<T> eventType, EventHandler<? super T> eventHandler) Unregisters a previously registered event handler from this target.final DoublePropertyThe horizontal scale that theWindowwill use when rendering itsSceneto the rendering buffer.final DoublePropertyThe vertical scale that theWindowwill use when rendering itsSceneto the rendering buffer.final voidRequests that thisWindowget the input focus.final ReadOnlyObjectProperty<Scene> TheSceneto be rendered on thisWindow.final voidSets the value of theeventDispatcherproperty.protected final <T extends Event>
voidsetEventHandler(EventType<T> eventType, EventHandler<? super T> eventHandler) Sets the handler to use for this event type.final voidsetForceIntegerRenderScale(boolean forced) Sets the value of theforceIntegerRenderScaleproperty.final voidsetHeight(double value) Sets the value of theheightproperty.final voidsetOnCloseRequest(EventHandler<WindowEvent> value) Sets the value of theonCloseRequestproperty.final voidsetOnHidden(EventHandler<WindowEvent> value) Sets the value of theonHiddenproperty.final voidsetOnHiding(EventHandler<WindowEvent> value) Sets the value of theonHidingproperty.final voidsetOnShowing(EventHandler<WindowEvent> value) Sets the value of theonShowingproperty.final voidsetOnShown(EventHandler<WindowEvent> value) Sets the value of theonShownproperty.final voidsetOpacity(double value) Sets the value of theopacityproperty.final voidsetRenderScaleX(double scale) Sets the value of therenderScaleXproperty.final voidsetRenderScaleY(double scale) Sets the value of therenderScaleYproperty.voidsetUserData(Object value) Convenience method for setting a single Object property that can be retrieved at a later date.final voidsetWidth(double value) Sets the value of thewidthproperty.final voidsetX(double value) Sets the value of thexproperty.final voidsetY(double value) Sets the value of theyproperty.protected voidshow()Attempts to show this Window by setting visibility to truefinal ReadOnlyBooleanPropertyWhether or not thisWindowis showing (that is, open on the user's system).voidSet the width and height of this Window to match the size of the content of this Window's Scene.final ReadOnlyDoublePropertyThe width of thisWindow.final ReadOnlyDoublePropertyThe horizontal location of thisWindowon the screen.final ReadOnlyDoublePropertyThe vertical location of thisWindowon the screen.Methods declared in class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods declared in interface Styleable
getStyleableNodeModifier and TypeMethodDescriptiondefault NodeReturns the Node that represents this Styleable object.
-
Property Details
-
text
The text to display in the tooltip. If the text is set to null, an empty string will be displayed, despite the value being null.- See Also:
-
textAlignment
Specifies the behavior for lines of text when text is multiline. UnlikecontentDisplaywhich affects the graphic and text, this setting only affects multiple lines of text relative to the text bounds.- See Also:
-
textOverrun
Specifies the behavior to use if the text of theTooltipexceeds the available space for rendering the text.- See Also:
-
wrapText
If a run of text exceeds the width of the Tooltip, then this variable indicates whether the text should wrap onto another line.- See Also:
-
font
The default font to use for text in the Tooltip. If the Tooltip'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:
-
showDelay
The delay between the mouse entering the hovered node and when the associated tooltip will be shown to the user. The default delay is 1000ms.- Default value:
- 1000ms
- Since:
- 9
- See Also:
-
showDuration
The duration that the tooltip should remain showing for until it is no longer visible to the user. If the mouse leaves the control before the showDuration finishes, then the tooltip will remain showing for the duration specified in thehideDelayProperty(), even if the remaining time of the showDuration is less than the hideDelay duration. The default value is 5000ms.- Default value:
- 5000ms
- Since:
- 9
- See Also:
-
hideDelay
The duration in which to continue showing the tooltip after the mouse has left the node. Once this time has elapsed the tooltip will hide. The default value is 200ms.- Default value:
- 200ms
- Since:
- 9
- See Also:
-
graphic
An optional icon for the Tooltip. This can be positioned relative to the text by using thecontent displayproperty. The node specified for this variable cannot appear elsewhere in the scene graph, otherwise theIllegalArgumentExceptionis thrown. See the class description ofNodefor more detail.- See Also:
-
contentDisplay
Specifies the positioning of the graphic relative to the text.- See Also:
-
graphicTextGap
The amount of space between the graphic and text- See Also:
-
activated
Typically, the tooltip is "activated" when the mouse moves over a Control. There is usually some delay between when the Tooltip becomes "activated" and when it is actually shown. The details (such as the amount of delay, etc) is left to the Skin implementation.- See Also:
-
-
Constructor Details
-
Tooltip
public Tooltip()Creates a tooltip with an empty string for its text. -
Tooltip
Creates a tooltip with the specified text.- Parameters:
text- A text string for the tooltip.
-
-
Method Details
-
install
-
uninstall
-
textProperty
The text to display in the tooltip. If the text is set to null, an empty string will be displayed, despite the value being null.- Returns:
- the text property
- See Also:
-
setText
Sets the value of thetextproperty.- Property description:
- The text to display in the tooltip. If the text is set to null, an empty string will be displayed, despite the value being null.
- Parameters:
value- the value for thetextproperty- See Also:
-
getText
Gets the value of thetextproperty.- Property description:
- The text to display in the tooltip. If the text is set to null, an empty string will be displayed, despite the value being null.
- Returns:
- the value of the
textproperty - See Also:
-
textAlignmentProperty
Specifies the behavior for lines of text when text is multiline. UnlikecontentDisplaywhich affects the graphic and text, this setting only affects multiple lines of text relative to the text bounds.- Returns:
- the text alignment property
- See Also:
-
setTextAlignment
Sets the value of thetextAlignmentproperty.- Property description:
- Specifies the behavior for lines of text when text is multiline.
Unlike
contentDisplaywhich affects the graphic and text, this setting only affects multiple lines of text relative to the text bounds. - Parameters:
value- the value for thetextAlignmentproperty- See Also:
-
getTextAlignment
Gets the value of thetextAlignmentproperty.- Property description:
- Specifies the behavior for lines of text when text is multiline.
Unlike
contentDisplaywhich affects the graphic and text, this setting only affects multiple lines of text relative to the text bounds. - Returns:
- the value of the
textAlignmentproperty - See Also:
-
textOverrunProperty
Specifies the behavior to use if the text of theTooltipexceeds the available space for rendering the text.- Returns:
- the text overrun property
- See Also:
-
setTextOverrun
Sets the value of thetextOverrunproperty.- Property description:
- Specifies the behavior to use if the text of the
Tooltipexceeds the available space for rendering the text. - Parameters:
value- the value for thetextOverrunproperty- See Also:
-
getTextOverrun
Gets the value of thetextOverrunproperty.- Property description:
- Specifies the behavior to use if the text of the
Tooltipexceeds the available space for rendering the text. - Returns:
- the value of the
textOverrunproperty - See Also:
-
wrapTextProperty
If a run of text exceeds the width of the Tooltip, then this variable indicates whether the text should wrap onto another line.- Returns:
- the wrap text property
- See Also:
-
setWrapText
public final void setWrapText(boolean value) Sets the value of thewrapTextproperty.- Property description:
- If a run of text exceeds the width of the Tooltip, then this variable indicates whether the text should wrap onto another line.
- Parameters:
value- the value for thewrapTextproperty- See Also:
-
isWrapText
public final boolean isWrapText()Gets the value of thewrapTextproperty.- Property description:
- If a run of text exceeds the width of the Tooltip, then this variable indicates whether the text should wrap onto another line.
- Returns:
- the value of the
wrapTextproperty - See Also:
-
fontProperty
The default font to use for text in the Tooltip. If the Tooltip'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 font property
- See Also:
-
setFont
Sets the value of thefontproperty.- Property description:
- The default font to use for text in the Tooltip. If the Tooltip'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 thefontproperty- See Also:
-
getFont
Gets the value of thefontproperty.- Property description:
- The default font to use for text in the Tooltip. If the Tooltip'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
fontproperty - See Also:
-
showDelayProperty
The delay between the mouse entering the hovered node and when the associated tooltip will be shown to the user. The default delay is 1000ms.- Default value:
- 1000ms
- Returns:
- show delay property
- Since:
- 9
- See Also:
-
setShowDelay
Sets the value of theshowDelayproperty.- Property description:
- The delay between the mouse entering the hovered node and when the associated tooltip will be shown to the user. The default delay is 1000ms.
- Default value:
- 1000ms
- Parameters:
showDelay- the value for theshowDelayproperty- Since:
- 9
- See Also:
-
getShowDelay
Gets the value of theshowDelayproperty.- Property description:
- The delay between the mouse entering the hovered node and when the associated tooltip will be shown to the user. The default delay is 1000ms.
- Default value:
- 1000ms
- Returns:
- the value of the
showDelayproperty - Since:
- 9
- See Also:
-
showDurationProperty
The duration that the tooltip should remain showing for until it is no longer visible to the user. If the mouse leaves the control before the showDuration finishes, then the tooltip will remain showing for the duration specified in thehideDelayProperty(), even if the remaining time of the showDuration is less than the hideDelay duration. The default value is 5000ms.- Default value:
- 5000ms
- Returns:
- the show duration property
- Since:
- 9
- See Also:
-
setShowDuration
Sets the value of theshowDurationproperty.- Property description:
- The duration that the tooltip should remain showing for until it is no longer visible to the user.
If the mouse leaves the control before the showDuration finishes, then the tooltip will remain showing
for the duration specified in the
hideDelayProperty(), even if the remaining time of the showDuration is less than the hideDelay duration. The default value is 5000ms. - Default value:
- 5000ms
- Parameters:
showDuration- the value for theshowDurationproperty- Since:
- 9
- See Also:
-
getShowDuration
Gets the value of theshowDurationproperty.- Property description:
- The duration that the tooltip should remain showing for until it is no longer visible to the user.
If the mouse leaves the control before the showDuration finishes, then the tooltip will remain showing
for the duration specified in the
hideDelayProperty(), even if the remaining time of the showDuration is less than the hideDelay duration. The default value is 5000ms. - Default value:
- 5000ms
- Returns:
- the value of the
showDurationproperty - Since:
- 9
- See Also:
-
hideDelayProperty
The duration in which to continue showing the tooltip after the mouse has left the node. Once this time has elapsed the tooltip will hide. The default value is 200ms.- Default value:
- 200ms
- Returns:
- the hide delay property
- Since:
- 9
- See Also:
-
setHideDelay
Sets the value of thehideDelayproperty.- Property description:
- The duration in which to continue showing the tooltip after the mouse has left the node. Once this time has elapsed the tooltip will hide. The default value is 200ms.
- Default value:
- 200ms
- Parameters:
hideDelay- the value for thehideDelayproperty- Since:
- 9
- See Also:
-
getHideDelay
Gets the value of thehideDelayproperty.- Property description:
- The duration in which to continue showing the tooltip after the mouse has left the node. Once this time has elapsed the tooltip will hide. The default value is 200ms.
- Default value:
- 200ms
- Returns:
- the value of the
hideDelayproperty - Since:
- 9
- See Also:
-
graphicProperty
An optional icon for the Tooltip. This can be positioned relative to the text by using thecontent displayproperty. The node specified for this variable cannot appear elsewhere in the scene graph, otherwise theIllegalArgumentExceptionis thrown. See the class description ofNodefor more detail.- Returns:
- the graphic property
- See Also:
-
setGraphic
Sets the value of thegraphicproperty.- Property description:
- An optional icon for the Tooltip. This can be positioned relative to the
text by using the
content displayproperty. The node specified for this variable cannot appear elsewhere in the scene graph, otherwise theIllegalArgumentExceptionis thrown. See the class description ofNodefor more detail. - Parameters:
value- the value for thegraphicproperty- See Also:
-
getGraphic
Gets the value of thegraphicproperty.- Property description:
- An optional icon for the Tooltip. This can be positioned relative to the
text by using the
content displayproperty. The node specified for this variable cannot appear elsewhere in the scene graph, otherwise theIllegalArgumentExceptionis thrown. See the class description ofNodefor more detail. - Returns:
- the value of the
graphicproperty - See Also:
-
contentDisplayProperty
Specifies the positioning of the graphic relative to the text.- Returns:
- the content display property
- See Also:
-
setContentDisplay
Sets the value of thecontentDisplayproperty.- Property description:
- Specifies the positioning of the graphic relative to the text.
- Parameters:
value- the value for thecontentDisplayproperty- See Also:
-
getContentDisplay
Gets the value of thecontentDisplayproperty.- Property description:
- Specifies the positioning of the graphic relative to the text.
- Returns:
- the value of the
contentDisplayproperty - See Also:
-
graphicTextGapProperty
The amount of space between the graphic and text- Returns:
- the graphic text gap property
- See Also:
-
setGraphicTextGap
public final void setGraphicTextGap(double value) Sets the value of thegraphicTextGapproperty.- Property description:
- The amount of space between the graphic and text
- Parameters:
value- the value for thegraphicTextGapproperty- See Also:
-
getGraphicTextGap
public final double getGraphicTextGap()Gets the value of thegraphicTextGapproperty.- Property description:
- The amount of space between the graphic and text
- Returns:
- the value of the
graphicTextGapproperty - See Also:
-
isActivated
public final boolean isActivated()Gets the value of theactivatedproperty.- Property description:
- Typically, the tooltip is "activated" when the mouse moves over a Control. There is usually some delay between when the Tooltip becomes "activated" and when it is actually shown. The details (such as the amount of delay, etc) is left to the Skin implementation.
- Returns:
- the value of the
activatedproperty - See Also:
-
activatedProperty
Typically, the tooltip is "activated" when the mouse moves over a Control. There is usually some delay between when the Tooltip becomes "activated" and when it is actually shown. The details (such as the amount of delay, etc) is left to the Skin implementation.- Returns:
- the
activatedproperty - See Also:
-
getClassCssMetaData
Gets theCssMetaDataassociated with this class, which may include theCssMetaDataof its superclasses.- Returns:
- the
CssMetaData - Since:
- JavaFX 8.0
-
getCssMetaData
The CssMetaData of this Styleable. This may be returned as an unmodifiable list.- Specified by:
getCssMetaDatain interfaceStyleable- Overrides:
getCssMetaDatain classPopupControl- Returns:
- the CssMetaData
- Since:
- JavaFX 8.0
-