Ajay
Ajay

Reputation: 125

How to change linespacing of TextArea in JavaFX

I want to change the lineSpacing(line height) of TextArea,how is that possible,CSS didn't help, i tried the following codes:

    -fx-line-height: 4px;
    -fx-line-spacing: 4px;

Upvotes: 7

Views: 2374

Answers (1)

blaqICE
blaqICE

Reputation: 49

JavaFX adding line spacing to 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 the css for the textarea only else the css will be applied to any text object be it Label text or TextArea text or even ComboBox text.

Upvotes: 2

Related Questions