chabeee chabeee - 1 year ago 141
Java Question

Html contents in a vaadin label

Is it possible to draw html contents in vaadin label?

I have texts with

contents. Is it available to let the label to use them?

Answer Source

Yes, you can use the 2 argument constructor of Label and set the ContentMode to HTML.

Something like,

new Label(YOUR_HTML_TEXT, ContentMode.HTML);

From the Javadoc (linked above):

Label component for showing non-editable short texts. The label content can be set to the modes specified by ContentMode

The contents of the label may contain simple formatting:

  • Bold
  • Italic
  • Underlined
  • Linebreak
  • ...
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download