cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Setting text color in dataUtility

AntonBagryanov
3-Visitor

Setting text color in dataUtility

Hi to all!

How can I set the text color inside the dataUtility?

localDispText = new TextDisplayComponent((String)localName);

((TextDisplayComponent)localDispText).setValue((String)localName);

Thanks a lot!

1 ACCEPTED SOLUTION

Accepted Solutions

Create your own LabelRenderer inside your dataUtility class like following:

class TextRenderer extends LabelRenderer

{

protected void renderObject(Object obj, PrintWriter printwriter, RenderingContext renderingcontext) throws RenderingException

{

Label label = (Label)obj;

String color= "#ff0000";

write(printwriter,"<b style=\"color:" + color + "\">"+label.getValue()+"</b>");

}

}

View solution in original post

1 REPLY 1

Create your own LabelRenderer inside your dataUtility class like following:

class TextRenderer extends LabelRenderer

{

protected void renderObject(Object obj, PrintWriter printwriter, RenderingContext renderingcontext) throws RenderingException

{

Label label = (Label)obj;

String color= "#ff0000";

write(printwriter,"<b style=\"color:" + color + "\">"+label.getValue()+"</b>");

}

}

View solution in original post

Announcements