Welcome to the Official BlackBerry® Support Community Forums. This is your resource to discuss support topics with your peers, and learn from each other. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Java Development

Reply
Developer
skicson
Posts: 56
Registered: 07-14-2008

RichTextField getForegroundColors...what's the point?

I'd like to be able to color individual pieces of text in a rich text field without having to write the entire thing myself. 

 

I see that RichTextField has a protected method call "getForegroundColors()" which returns an array of colors corresponding the regions in the RichTextField.    I tried overriding the method in order to specify which colors I wanted for the given regions but it didn't make any difference.

 

So my question is, what is the point of getForegroundColors() if there is no way to set them?  Wouldn't it always  just return the default color?   If there is a way to set them, how does one do it?

 

TIA.

Please use plain text.
Administrator
MSohm
Posts: 11,465
Registered: 07-09-2008
My Carrier: Bell

Re: RichTextField getForegroundColors...what's the point?

A RichTextField allows you to set different text styles within it (bold, italic, etc..).  It does not currently support different colours within text.  You can see an example of this here:

 

How To - Format text in a RichTextField
Article Number: DB-00124

http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800332/800505/800345/...

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Found a bug? Report it using the Issue Tracker
Please use plain text.