Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
New Developer
Posts: 57
Registered: ‎06-02-2009
My Device: Not Specified

How to set color for a word in a sentence .

How to set color for a word in a sentence . i.e . In the sentence Join Conference as Guest or Host . In this sentence i want to set Guest and

Host as Red color . Please reply .

Developer
Posts: 4,764
Registered: ‎07-21-2008
My Device: Not Specified

Re: How to set color for a word in a sentence .

You'll need to use RichTextField (or one of it's subclasses).

 

New Developer
Posts: 57
Registered: ‎06-02-2009
My Device: Not Specified

Re: How to set color for a word in a sentence .

Please provide some code sample for setting color for a particular word in a sentence . Thanks in advance .
Highlighted
Developer
Posts: 17,012
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: How to set color for a word in a sentence .

the API states:
See the BlackBerry Application Developer Guide Volume 1 for more information on formatting text in a RichTextField

and so do I
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Developer
Posts: 984
Registered: ‎02-10-2009
My Device: Not Specified

Re: How to set color for a word in a sentence .

Chech this KB article.

 

How To - Format text in a RichTextField
http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800332/800505/800345/...

 

Regards

Bikas

 

Developer
Posts: 166
Registered: ‎05-07-2009
My Device: Not Specified

Re: How to set color for a word in a sentence .

[ Edited ]
[Removed: Totally wrong comment was here]
Message Edited by SergGr on 07-10-2009 06:25 PM

--------------------------------------------------------------------------------------------------------
If your issue is solved, set "Solution" mark at the relevant post.
Don't hesitate to Kudos people whose posts helped you.
Developer
Posts: 696
Registered: ‎12-02-2008
My Device: Not Specified

Re: How to set color for a word in a sentence .

Hi,

 

You can use this class to achieve what you want net.rim.device.api.ui.component.ActiveRichTextField

 

 

 

Regards,
Rajat Gupta.
--------------------------------------------------------------------------------
If your problem was get solved then please mark the thread as "Accepted solution" and kudos - your wish