Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Programatically setting the text colour of a label in GWT

Tags:

gwt

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

like image 255
MayoMan Avatar asked Feb 17 '23 20:02

MayoMan


1 Answers

Try something like this:

label.getElement().getStyle().setColor("red");
like image 108
Maksym Demidas Avatar answered Mar 23 '23 02:03

Maksym Demidas