Irash
Irash

Reputation: 75

JavaFX Label Wrap Text Line Spacing

I need a feature so I can write down text vertically for my JavaFX 8 application. I came up with the idea of using a label, with a preferred width of 0, and wrap text on true. This indeed causes the text to be written vertically, as I require. But it consumes too much space, because the height between each line, so the line spacing is too much, but this already was at 0.

<Label fx:id="label_north" alignment="BOTTOM_CENTER" prefHeight="240.0" prefWidth="0.0" textAlignment="CENTER" wrapText="true">
     <padding>
        <Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
     </padding>
</Label>

Image Which Shows The Space Between Lines Is Massive

So does anyone know a css property to fix this? Because -fx-line-spacing's default is 0, so it is 0 right now, but well, 0 is massive?

Upvotes: 5

Views: 2728

Answers (1)

Boris Pavlović
Boris Pavlović

Reputation: 64632

What about negative value for -fx-line-spacing? The default is 0, but it may accept negative values...

Upvotes: 7

Related Questions