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
Administrator
MSohm
Posts: 12,957
Registered: ‎07-09-2008
My Carrier: Bell

Text with more than one color

Quote from the previous forum:


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

Thanks


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
http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800332/800505/800345/...

 

How To - Change the text color of a field
Article Number: DB-00114
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.
Developer
someswararao
Posts: 40
Registered: ‎07-16-2008

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)
 {
  super();
  LabelField title = new LabelField("Search Results...",LabelField.ELLIPSIS|LabelField.USE_ALL_WIDTH);
  setTitle(title);

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

  myList.setCallback(myCallback);

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


 

 

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

 

Thanks in Advance

 

 

Please use plain text.
Developer
simon_hain
Posts: 13,775
Registered: ‎07-29-2008
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
Please use plain text.