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. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Java Development

Reply
New Developer
rahul8270
Posts: 57
Registered: ‎06-02-2009

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 .

Please use plain text.
Developer
RexDoug
Posts: 4,764
Registered: ‎07-21-2008

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

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

 

Please use plain text.
New Developer
rahul8270
Posts: 57
Registered: ‎06-02-2009

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 .
Please use plain text.
Developer
simon_hain
Posts: 14,064
Registered: ‎07-29-2008
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
Please use plain text.
Developer
bikas
Posts: 984
Registered: ‎02-10-2009

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

 

Please use plain text.
Developer
SergGr
Posts: 166
Registered: ‎05-07-2009

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.
Please use plain text.
Developer
Rajat_10Sep
Posts: 685
Registered: ‎12-02-2008

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
Please use plain text.