Skip to content

Show Tooltip on disabled Control in JavaFX

It is possible to show a Tooltip on a disabled Control?

I have the following code and this doesn’t work:

txt.searchText.setTooltip(new Tooltip("Message"));

Has anyone a solution for that problem?




The answer is no. Currently you cannot show a tooltip on disabled Node, for the simple reason that disabled Nodes do not receive any MouseEvents.

You can see the issue being raised in the official issue tracler here (require login) :

One solution to your problem could be to wrap your Control into something else.

For example, put your control into another Control, like a SplitPane or a Label. Then you could apply your tooltip to that wrapper and disable your first control.

4 People found this is helpful