views:

52

answers:

1

Hi Friends

Can you please send me any example code on label color , by default it shows black color i want to change the color for look and feel in UI please help me ..

Thanking you

+1  A: 

you can do like this

  LabelField label = new LabelField("label"){
            protected void paintBackground(Graphics g) {
                g.setBackgroundColor(Color.BLUE);
                g.clear();
                super.paintBackground(g);
            }
        };

or like this

LabelField label = new LabelField("label"){
            protected void paint(Graphics g) {
                int oldColor = g.getColor();
                g.setColor(Color.BLUE);
                g.fillRoundRect(0, 0, getWidth(), getHeight(), 7, 7);
                g.setColor(oldColor);
                super.paint(g);
            }

        };
Vivart
thankq so.... much
upendra