问题
Can you please send me any example code on label color , by default it shows black color i want to change the color for look and feel in UI please help me ..
Thanking you
回答1:
you can do like this
LabelField label = new LabelField("label"){
protected void paintBackground(Graphics g) {
g.setBackgroundColor(Color.BLUE);
g.clear();
super.paintBackground(g);
}
};
or like this
LabelField label = new LabelField("label"){
protected void paint(Graphics g) {
int oldColor = g.getColor();
g.setColor(Color.BLUE);
g.fillRoundRect(0, 0, getWidth(), getHeight(), 7, 7);
g.setColor(oldColor);
super.paint(g);
}
};
来源:https://stackoverflow.com/questions/3014109/how-to-change-label-color-in-blackberry-using-eclipse