vaks.in's Blog

a new Life, as the Oracle

Posts Tagged ‘bold text

Setting a Bold and Colorize Text

leave a comment »

this is how to create a RichTextField with style Bold and Red color.

RichTextField rtf = new RichTextField(element,RichTextField.TEXT_ALIGN_LEFT){
  // Override the paint method to set Color.
  public void paint(Graphics graphics) {
    graphics.setColor(Color.RED);
    super.paint(graphics);
  }
};
rtf.setFont(Font.getDefault().derive(Font.BOLD));

Written by v4ks1n

29/04/2009 at 04:24

Posted in blackberry

Tagged with , ,