开发者

OnFocus how to change border color of TextBoxField in blackberry

开发者 https://www.devze.com 2023-01-07 12:17 出处:网络
I am using the following code for TextBoxFi开发者_运维问答eld: http://na.blackberry.com/eng/devjournals/resources/journals/jul_2005/creating_textbox_field.jsp

I am using the following code for TextBoxFi开发者_运维问答eld: 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,


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());
    }
}
0

精彩评论

暂无评论...
验证码 换一张
取 消