Turing85 Turing85 - 21 days ago 19
CSS Question

control JavaFX Tooltip delay

I was playing around with JavaFX Tooltip. I realized that for me personally the delay between hovering over something and the tooltip actually appearing is too long. A look in the API reveales:


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.


After some further investigation, I was not able to find any possibility to control this behavior. The JavaFX CSS Reference has no information about delay time and a runtime-evaluation of
getCssMetaData()
did not help either.

I know, that there is a way to control the tooltips manually via
onMouseEntered
and
onMouseExited
, but is there really no other way? Or am I missing an obvious option?

Answer

There is an existing feature request for this: JDK-8090477 Customizable visibility timing for Tooltip.

The feature request is currently scheduled for integration into Java 9. Attached to the issue I linked is a patch you can apply to allow you to get this functionality in earlier Java versions.

Your other option is just to create your own popup control using one of the techniques in: