开发者

OnFocus how to change border color of TextBoxField in blackberry

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜