views:

12

answers:

1

Hi All,

I am using the following code for TextBoxField: http://na.blackberry.com/eng/devjournals/resources/journals/jul_2005/creating_textbox_field.jsp

now i am trying to change TextBoxField border color when it focused. But could not able to get. need some help on this.

Thanks,

A: 

Try this code :

protected void paint(Graphics g) {
    if (isFocus()) {
    super.paint(g);
    g.setColor(Color.BLACK);
    g.drawRect(0, 0, getWidth(), getHeight());
    } else {
        super.paint(g);
        g.setColor(Color.WHITE);
        g.drawRect(0, 0, getWidth(), getHeight());
    }
}
rupesh
Thanks rupesh, i got the answer at bb forum i.ehttp://supportforums.blackberry.com/t5/Java-Development/OnFocus-how-to-change-border-color-of-TextBoxField/m-p/544178#M110095very well explained.
amsiddh