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

BlackBerry Development Advisor
Posts: 15,813
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Text with more than one color

Quote from the previous forum:

Text with more than one color
Posted: Jul 16, 2008 10:30 AM
Does RichTextField support more than one color? How is it done?


The RichTextField does not support nativly support this.  Please see the following links for more information.


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


How To - Change the text color of a field
Article Number: DB-00114

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Posts: 40
Registered: ‎07-16-2008
My Device: Not Specified

Re: Text with more than one color

Thanks for repply,


 i tried this...but it is not helped me.


I have added ListField and i have added the data also... data is soo lengthy... so i am unable to see all the data...


i am able to see vertical scrole bar automatically, as per above url, i have added the horizantal scrole also...


but it is not working...


please find the below code.

  public SearchResultsScreen(String sessionID,CaseInfo[] resultsList)
  LabelField title = new LabelField("Search Results...",LabelField.ELLIPSIS|LabelField.USE_ALL_WIDTH);

  HorizontalFieldManager hfm = new HorizontalFieldManager(Manager.HORIZONTAL_SCROLL | Manager.NO_HORIZONTAL_SCROLLBAR);
  ListField myList = new ListField();
      ListCallback  myCallback = new ListCallback();


  List = new Info[resultsList.length];
  for(int i=0;i<resultsList.length;i++)
   Info = (Info)resultsList[i];
   myCallback.insert(Info.getCaseId()+ "-" + Info.getTitle(), i);
   List[i] = resultsList[i];



Please let me know...what else i need to do for this...?


Thanks in Advance



Posts: 17,019
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Text with more than one color

i would suggest to either overwrite paint or create an own field (which would be similar). use drawtext to paint the text parts and setcolor to change the color in between.

i have no clue about adding a scrolling bar to a listfield. i would suggest to either display a summary of the information or make the listrow bigger by extending the rowheight of the listfield and using the space accordingly in the draw callback.
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