Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
White space in Label
I'd like to dynamically write a text using labels, and the fact that Label objects ignore spaces which are written at the very beginning or at the end is not helping. Things like " and " get cropped into "and". Is there any way around this? Thanks!
Label content mode pre will preserve whitespace, but causes other behavior you don't necessarily want. With HTML content mode you can use which doesn't get stripped, but that forces you to sanitize your content. Dynamically created text and HTML content mode sounds like a fragile combination - just saying.