BlackBerry Forums Support Community

BlackBerry Forums Support Community (http://www.blackberryforums.com/)
-   Developer Forum (http://www.blackberryforums.com/developer-forum/)
-   -   RichTextField (http://www.blackberryforums.com/developer-forum/143854-richtextfield.html)

vashgaurav 08-06-2008 02:50 AM

RichTextField
 
I need to change the background color of the text written in the RichTextField but I have not managed to do it so far. Any help in this regard will he highly appreciated


Thanks in Advance!!
Gaurav

bemshaswing 08-06-2008 09:20 AM

You will need to create a class that extends RichTextField. In that class, override the paint method like so:

public void paint(Graphics g) {
g.setBackgroundColor(whateverYourBackgroundColorIs );
g.clear();
g.setColor(theColorOfTheTextFont);
}

vashgaurav 08-08-2008 04:18 AM

Thnx.

- Gaurav

simon.hain 08-08-2008 04:24 AM

Quote:

Originally Posted by bemshaswing (Post 1048382)
You will need to create a class that extends RichTextField.

you can also overwrite the method directly on creation of your class.
new RichTextField(){protected void paintBackground...}


All times are GMT -5. The time now is 11:29 AM.

Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.