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());
}
}
精彩评论