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


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Developer
Posts: 153
Registered: ‎09-03-2009
My Device: Not Specified

How to draw mutli line text in the listfield? use drawText method

Because many text is too long to show all text. so i hope i can draw the mutli line text. or how to make the text in  the listfield scrollable.

graphics.drawText(storenameture, 0, y, DrawStyle.TOP, width);
  graphics.drawText(mallnameture, 0, y,DrawStyle.BOTTOM,width);

i use the DrawStyle.top and bottom . but can not show the mutli line.

Thanks!

Developer
Posts: 696
Registered: ‎12-02-2008
My Device: Not Specified

Re: How to draw mutli line text in the listfield? use drawText method

Hi,

 

Just change the value of "y" when you draw your second string.

 

It will sove your problem.

Regards,
Rajat Gupta.
--------------------------------------------------------------------------------
If your problem was get solved then please mark the thread as "Accepted solution" and kudos - your wish
Developer
Posts: 183
Registered: ‎12-17-2008
My Device: 8320

Re: How to draw mutli line text in the listfield? use drawText method

use own wraptext function in your code?
kums

******************************

Press kudos which the post help you
Please mark posts as solved if you got a solution
Developer
Posts: 17,025
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: How to draw mutli line text in the listfield? use drawText method

first, use setRowHeight with the double of the font height.
use drawtext normally the first time, add half the rowheight to y for the second line
----------------------------------------------------------
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
Highlighted
New Developer
Posts: 6
Registered: ‎11-04-2009
My Device: Not Specified

Re: How to use line break in listfield

i m strucked with listfield i m trying to add multiple line in listfield and also want to break the line eactly how to perform the lablefield align the line properly

Developer
Posts: 3,951
Registered: ‎07-15-2008
My Device: Not Specified

Re: How to use line break in listfield

Where exactly you ahve stuck? Have you able to display the ListField on screen? Have you tried with setting the rowheight and displaying the listField?


Use Search. "Accept Solution" If the problem is resolved.
Developer
Posts: 255
Registered: ‎05-03-2012
My Device: 9930
My Carrier: Vodafone

Re: How to draw mutli line text in the listfield? use drawText method

@simon_hain : how to use it?
Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: How to draw mutli line text in the listfield? use drawText method

Simon's code is pretty specific so I'm not sure what you don't understand.  Remember that this Thread is talking about the ListField, which is a specific Field used In BlackBerry UI.  If you are not using a ListField, then this code will not be applicable. 

 

Most usual Blackberry Fields (e.g. RichTextField) will create multiple lines by themselves. 

Developer
Posts: 255
Registered: ‎05-03-2012
My Device: 9930
My Carrier: Vodafone

Re: How to draw mutli line text in the listfield? use drawText method

I am using ListField.
Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: How to draw mutli line text in the listfield? use drawText method

If you don't already know ListField, then this is not a great Thread to start the learning process.  Search for easier examples.

 

If you know how to use ListField, I think Simon's code makes sense as it is - these are just lines you will code in your drawListRow.  What specifically do you not understand?