GWT: Putting raw HTML inside a Label

后端 未结 5 2794
情深已故
情深已故 2021-02-20 08:26

Is there a way to put raw HTML inside of a Label widget with GWT? The constructor and setText() methods automatically escape the text for HTML (so

5条回答
  •  伪装坚强ぢ
    2021-02-20 08:36

    Either create a label and set it to bold:

    Label label = new Label("text");
    label.getElement().getStyle().setFontWeight(FontWeight.BOLD);
    

    Or you can create a SpanElement and set its innerHtml.

提交回复
热议问题