Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X
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!
Solved! Go to Solution.
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>");
}
}
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>");
}
}
Hi Anthony,
Can you please give a complete dataUtility example ?
Thank you in advance,
Hicham