Quote:
Originally Posted by arifzaman
Hi genvej,
Try with the following code:
Code:
RichTextField colorField = new RichTextField("Hello") {
// Override the paint method to set Color.
public void paint(Graphics graphics) {
graphics.setColor(Color.RED);
super.paint(graphics);
}
};
add(colorField);
Hope this will help!
Cheers,
ARIF
|
thx a bunch... however... Im also interested in changing the font, which your example doesnt let me do... i tried
public void paint(Graphics graphics) {
graphics.setFont(FieldFont());
graphics.setColor(Color.RED);
super.paint(graphics);
}
public static Font FieldFont(){
try {
FontFamily theFam = FontFamily.forName("BBCASUAL");
return theFam.getFont(net.rim.device.api.ui.Font.PLAIN, 31);
} catch (ClassNotFoundException ex) {
ex.printStackTrace();
}
return null;
}