我正在使用TextBoxField的以下代码: http://na.blackberry.com/eng/devjournals/resources/journals/jul_2005/creating_textbox_field.jsp
现在我正在尝试在聚焦时更改TextBoxField边框颜色。但无法得到。 需要一些帮助。
谢谢,
答案 0 :(得分:0)
试试这段代码:
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());
}
}