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.
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.
checkbox.setCaption("This is a line that should break\n and start a new line afterwards")
String caption = "This line should break\n" + "and then this line should start"
Label label2 = new Label("This line should break<br/>, start another one now", XHTML)
None of these methods work, what is the easiest way to set a checkbox caption and break at a certain point?
With an optiongroup it is possible:http://demo.vaadin.com/sampler#OptionGroupHtmlItems
Maybe you can watch in the source code how it is done