Tara1
(Tara Bendtner)
1
I have an incoming text string that contains a line break (“\r”).
When I output it with
System.out.println(myString)
, the carriage return is interpreted.
However, when I set the string as the Label’s content, it ignores the carriage return.
How can I force the Label to interpret the carriage/line return (without the XHTML mode) ?
Jouni1
(Jouni Koivuviita)
2
Use CSS:
.v-label {
white-space: pre-wrap;
}
The carriage return character IMO only works in Windows. Other platforms expect the new line character \n
Tara1
(Tara Bendtner)
3
Your solutions works partially :
If the label is in a GridLayout cell, the latter won’t expand after the CSS rule.
How can I make the GridLayout fit the pre-wrapped label ?
Thanks
Jouni1
(Jouni Koivuviita)
4
Haven’t encountered that before. Could you add a screenshot and more details about the environment and possibly a test case as well?