Linebreak and textediting in a Vaadin Label - how?

I want to add a linebreak in the text that I set as a Label’s value - and I am trying to achieve this as follows:

[code]
StringBuilder text = new StringBuilder();

String term = "one";
String val = "two"

text.append(term);
text.append("<br/>");
text.append(val);

getMyLabel.setValue(term.toString());

[/code]In the stead of

one
two

I get: one two . How can I get the label to display the former?

TK-

It’s all in the book…take a look at it-
link

Regards,
Eric

O yes, You’re right, I should habe looked it up in the book - now the code below won’t give me a bold caption without displaying the tags - instead of “bold text” I get “ bold text ”. I tried this both using Chrome and using IE, in either case, I got the same erroneous result :frowning:

comp.getMyLabel().setContentMode(ContentMode.HTML);
comp.getMyLabel().setCaption("<b> bold text </b>");

Hi TK Inter,

please change this

comp.getMyLabel().setCaption("<b> bold text </b>"); to this:

comp.getMyLabel().setValue("<b> bold text </b>");

I got it working recently - but I did it by putting my “ bold text ” - string into a Stringbuilder, which I then chucked into the label - amazingly, that worked.