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.
05-11-2013 09:47 AM
I have a labelfield with text.I want that when i click a button,the labelfield text should change.I have tried with labelfield.settext method,but its not working,plz help
Solved! Go to Solution.
05-11-2013 10:06 AM
<LabelField>.setText method does change the text. Debug the statement, I suspect it is throwing an Exception, probably because you are not invoking it on the Event Thread. .
05-11-2013 10:30 AM
if your LabelField is called lab and is on the screen, then
will update the display with "New Text", assuming you run this on the Event Thread.
05-12-2013 02:05 AM
yes true,but if i use draw text in paint method and than use settext in the onnavigation click of button field,text is overlapping on the old text,how to delete the old text
05-12-2013 05:40 AM
Ah - I thought you were using a standard LabelField. Might have been useful to mention that at the start.
If you really have to use drawText, then you should clear the area first. There are a variety of ways you can do that, but probably the easiest is to just call paintBackground in your paint() method.
Otherwise you can set the color and use fillRect. Review the Graphics API for more on these methods.
05-12-2013 05:43 AM
yes Peter i too hate using DrawText,but i dont have any option.Actually i need to position the text inside labelfield depending on alignment attribute value i am getting from an XMl,so suppose its CENTER,i am setting it at center in drawtext,anyways i will give ur solution a try and get back to u