JavaFx: How to make 'Tooltip' bigger?

2019-08-08 02:49发布

问题:

I set tooltip for buttons,but it looks so small(font size),how can I make it bigger?I have tried myTooltip.setFont(new Font(20)),but it dosen't work,why?And how can I make the font bigger? Thank you all guys!

回答1:

Set the style in a stylesheet, or directly, e. g.:

tooltip.setStyle("-fx-font-size: 20");