alaska.var
alaska.var

Reputation: 113

How to set a tooltip on a JavaFX Pane?

Method setToolTip() can't be used for pane, but аll the same, it is possible? How I can set a tooltip on a JavaFX Pane? Or how to display a toolbox at the cursor position?

Upvotes: 11

Views: 4251

Answers (1)

jewelsea
jewelsea

Reputation: 159321

Use the static Tooltip.install(node, tooltip) method to install a tooltip onto a node which does not possess a node.setTooltip(tooltip) method.

Pane pane = new Pane();
pane.setPrefSize(100, 100);
Tooltip tooltip = new Tooltip("This is a Pane");
Tooltip.install(pane, tooltip);

Upvotes: 20

Related Questions