GWT: Putting raw HTML inside a Label

e0qjcistopl

New Member
Is there a way to put raw HTML inside of a \[code\]Label\[/code\] widget with GWT? The constructor and \[code\]setText()\[/code\] methods automatically escape the text for HTML (so \[code\]<\[/code\] appears as \[code\]<\[/code\], etc).What I need is something like:\[code\]String matched = "two";List<String> values = Arrays.asList("one", "two", "three");StringBuilder sb = new StringBuilder();for (String v : values){ if (v.equals(matched)){ sb.append("<b>" + v + "<b>"); } else { sb.append(v); } sb.append(", ");}Label label = new Label();label.setRawText(sb.toString());//div contains the following HTML: "one, <b>two</b>, three, "\[/code\]I want to output a comma-separated list of Strings, but I want one of those Strings to be bolded. Thanks.
 
Top