How do I set the colour of the text in a label programatically. Here is my latest attempt.
public void setFontColour(String colour )
{
label.getElement().getStyle().setFontStyle( Style.FontStyle.valueOf("bluetext") );
}
I just want to make a call to the setColour method but everything I google for attempts to do this via CSS. In this instance I want to set it via Java.
Thanks
Try something like this:
label.getElement().getStyle().setColor("red");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With