This is a "style" (not an "attribute").  So, the corresponding Java code
would be:

 

Color color = colorChooser.getSelectedColor();

initComp.getStyles().put("backgroundColor", color);

 

~Roger

 

From: Ajay Bhat [mailto:[email protected]] 
Sent: Thursday, August 29, 2013 10:10 AM
To: [email protected]
Subject: Re: Coloring similar UI components

 

On Tue, Aug 27, 2013 at 10:51 PM, Ajay Bhat <[email protected]>
wrote:

        Hi,

         

        function onColorChange() {

            var color = colorChooser.selectedColor;

            sampleBorder.styles.put("backgroundColor", color);

        }

 

The above code is for Javascript. Is there a way I can do it in Java
code? I tried using setAttributes(T key, Object value) by using

 

Component initComp = Window.getActiveWindow();

System.out.println(initComp.getName());

Integer keyValue;

if (initComp instanceof Window) {

    initComp.setAttribute("backgroundColor", toHex());

     System.out.println("Window painted");

}

 

But its not working.

 

-- 

Thanks and regards,

Ajay Bhat

Reply via email to