Thank you for visiting the BlackBerry Support Community Forums.
BlackBerry will be closing the BlackBerry Support Community Forums on April 1st. 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
01-09-2009 12:24 AM
I have a problem.
In custom field that extends EditField, I want to draw in the text and the image and to draw to an appropriate position in the cursor. Then, it was thought that it only had to calculate the advance of the font and the width of the image in the paint method, to display the text and the image, and to make focus similar, and tried.However, drawing of the cursor doesn't go well. When the cursor moves from the right to the left, a part of the cursor at the position immediately before remains.
Is there a good solution?
JDE Component Package : 4.6.0
Solved! Go to Solution.
01-12-2009 03:16 PM
To "remove" the cursor, you could draw it in its previous location using the background colour for your field. This could "erase" the cursor before you draw text in its previous location.
Or you could call the clear method on the Graphics object to clear everything. However, this means you have to redraw the entire field.
01-13-2009 02:00 AM
Thank you for the reply, Mark.
I had the Graphics.clear() method processed first in the paint() method. However, a part of the cursor remained as it was. Then, the another way was tested. It is to call the invalidate() method in the drawFocus() method at the end. It seems to go well in this method. However, the paint() method and the drawFocus() method are called when almost permanent.
Will this be a correct solution? Moreover, why does not the Graphics.clear() method clear the drawing area?
01-16-2009 11:59 AM
This could relate to the size of the graphics object you are working with. A field can invalidate part of itself, meaning only that section is redrawn. Anything outside of this region would be left alone and not cleared by a call to Graphics.clear.
02-04-2009 03:32 AM
I solved by myself.
"FocusChangeListener" is mounted with EditField. And, "invalidate()" was called in the "focusChanged()" method.
This became a great result for me.