Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Set label properties dynamically from java code
Rocker
Hi,
I have this event Handler class which is creating labels on the fly. I am unable however to set its properties like font and padding through code. I am aware of the java script equivalent which is,
this.getStyle().backgroundColor="red";
but what is the Java way to do it??
I have created the label as:
LabelHandle label1=elementFactoryObject.newLabel("Label1");
No how to add the font and padding properties to this label1 object??
thanks in advance
Find more posts tagged with
Comments
Rocker
I guess I asked too soon..
Got it working finally and this is the equivalent java code;
StyleHandle labelStyle=label1.getPrivateStyle();
FontHandle fontHandle=labelStyle.getFontFamilyHandle();
fontHandle.setStringValue("Verdana");
DimensionHandle padd= labelStyle.getPaddingTop();
padd.setAbsolute(20);