Loading...
Important Notice - Forums is archived

To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Product icon
TUTORIAL

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.

Borderless Button with different color icon

venkata Narayana
7 years ago Jun 11, 2015 5:09am
Tatu Lund
7 years ago Jun 11, 2015 9:04am
venkata Narayana
7 years ago Jun 11, 2015 10:07am
Tatu Lund
7 years ago Jun 11, 2015 1:08pm
Tatu Lund
7 years ago Jun 11, 2015 1:13pm
venkata Narayana
6 years ago Aug 16, 2015 2:00pm

Hi,

I got the solution using captionAsHtml approch as given below.

String color = // Get from Database
String name = // Get from Database
Button button = new Button();
button.addStyleName(ValoTheme.BUTTON_BORDERLESS);
button.addStyleName(ValoTheme.BUTTON_TINY);
button.setCaptionAsHtml( true );
button.setCaption( "<span style=\'color: " + color + " !important;\'> " + FontAwesome.CIRCLE.getHtml()  + "</span>" + name );

Thanks,
Venkat