Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change linespacing of TextArea in JavaFX

Tags:

java

css

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;
like image 630
Ajay Avatar asked Mar 29 '16 14:03

Ajay


1 Answers

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.

like image 189
blaqICE Avatar answered Oct 09 '22 07:10

blaqICE