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

Reply
Developer
rtbsoft
Posts: 15
Registered: ‎11-06-2008
My Device: Not Specified

x,y coordinates of caret

Is there an api for determining the x,y coordinates of the caret in an editField? I would like to make a context menu appear at that location.

 

This would obviously only be required for the touch screen device(s).

 

thx

rick

Developer
RexDoug
Posts: 4,764
Registered: ‎07-21-2008
My Device: Not Specified

Re: x,y coordinates of caret

I think you will find that the the clipping rectangle will bracket the caret, or at least put you in the general area.

 

Override the paint() method in your field, and use Graphic.getClippingRectangle().