I would like to set a standard for all tooltips to be a specific width and have word wrap on. I would like to override the tooltip style. However I am unsure how to set those properties.
I can do it in code like this:
Tooltip taskname = new Tooltip();
taskname.setWrapText(true);
taskname.setPrefWidth(250);
However, I would prefer to set it once in the CSS - I tried like this but it didn't wrap:
.tooltip {
-fx-background: rgba(255,255,205);
-fx-text-fill: black;
-fx-background-color: rgba(255,255,205,0.95);
-fx-background-radius: 6px;
-fx-background-insets: 0;
-fx-padding: 0.667em 0.75em 0.667em 0.75em; /* 10px */
-fx-effect: dropshadow( three-pass-box , rgba(0,0,0,0.5) , 10, 0.0 , 0 , 3 );
-fx-font-size: 0.90em;
-fx-wrap-text: true;
-fx-pref-width: 250;
-fx-max-width: 250;
}
But I am not sure how to go about setting that. These settings don't seem to work for me.
Any help would be appreciated.
Thank you