I have been looking for multiline label trick in FXML
for some time and many times I visited this post (google displayed this result, a lot of frustration). So I think I will write it here.
I managed to find this code to display multiline:
<Label text="${'number of registered\nreaders'}"/>
But if I define variable
<fx:define>
<String fx:id="LABEL_01" fx:value="${'number of registered\nreaders'}"/>
</fx:define>
then I have no idea how to refer to it, I can't use $LABEL_01
.
In FXML
you can also use this: '
'
. Then this code works:
<fx:define>
<String fx:id="LABEL_01" fx:value="number of registered
readers"/>
</fx:define>
And you can use LABEL_01
like this:
<Label text="$LABEL_01"/>