It is possible to show a Tooltip on a disabled Control?
I have the following code and this doesn't work:
txt_searchText.setDisable(true);
txt.searchText.setTooltip(new Tooltip("Message"));
Has anyone a solution for that problem?
Thx
Not directly but you can warp your button into another control and while your button could be disable or not, the control will answer to mouse movements.
Button button = new Button("Click me"); //create a button
button.setDisable(true); //disable button in some way
SplitPane splitPane = new SplitPane(button); //warp it into a splitPane
splitPane.setTooltip(new Tooltip("I'm the Tooltip Massage")); //Crete a tooltip
Node that SplitPane extends "Controls" not Region and not pane.
so it's a Control and best for our case (warping buttons).
you must always use a Control to warp another control. other way you will not have access to setTooltip() method.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With