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.

TUTORIALVaadin lets you build secure, UX-first PWAs entirely in Java.
Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
Calling javascript synchronously by Enver Haase, 1 month ago
Vaadin Checkbox Caption: Newline character
When using the vaadin checkbox component, i want to set the caption of the checkbox and break (Create a new line) at a certain point. I have tried several ways and none of them work.
1)
checkbox.setCaption("This is a line that should break\n and start a new line afterwards")
2)
String caption = "This line should break\n" + "and then this line should start"
checkbox.setCaption(caption.toString());
3)
Label label2 = new Label("This line should break<br/>, start another one now", XHTML)
checkbox.setCaption(label2.getCaption());
None of these methods work, what is the easiest way to set a checkbox caption and break at a certain point?
Last updated on
With an optiongroup it is possible:
http://demo.vaadin.com/sampler#OptionGroupHtmlItems
Maybe you can watch in the source code how it is done
Last updated on Feb, 29th 2012
You cannot reply to this thread.