cadmy cadmy - 1 year ago 225
Java Question

How to output label with icon in line?

Text of the label jumps on a next line when I use

. How to output it in one line?

Label info = new Label("Reports are generated every day at 5 pm", ContentMode.HTML);
info.setIcon( new ThemeResource("img/icons/information.png") ) ;
JobsLayout.addComponent( info );
JobsLayout.setComponentAlignment(info, Alignment.MIDDLE_RIGHT);

Answer Source

You can use icon inside label text:

Label date = new Label(FontAwesome.CALENDAR.getHtml() + " " + new Date());

Source: Vaadin Wiki.


Vaadin label with icon in the same line.