How to change the line spacing of textarea in JavaFX
•
Java
I want to change the linespacing (line height) of textarea. How is it possible? CSS is not helpful. I tried the following code:
-fx-line-height: 4px; -fx-line-spacing: 4px;
Solution
JavaFX adds line spacing to the text area
.text-area { -fx-font-family: Helvetica; -fx-text-fill: rgb(33,33,33); -fx-font-size: 13px; } .text-area .text { -fx-line-spacing: 10px; }
Remember to create CSS only for textarea, otherwise CSS will be applied to any text object, whether label text, textarea text, or even Combo@R_201_2419 @Text
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码