Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

How to get caret screen coordinates in TextArea?

1003746May 5 2013 — edited May 6 2013
Hello,

I am using a TextArea and, when writing some words, I want to display a popup with the suggestions when the user presses CTRL+SPACE. However, I did not find anything that could give me the screen coordinates of the caret.

So, how can I find out the coordinates of the caret ( I plan to use it in a key press event handler ), or if it's not possible at the moment, what workaround do I have for my scenario? (please note that I want to show the popup at the caret position, and not anywhere on the screen as it would be strange to show it at the center of the TextArea for example).

Regards,
subzero

Edited by: subzero on May 5, 2013 3:19 PM

Edited by: subzero on May 5, 2013 3:19 PM
This post has been answered by James_D on May 5 2013
Jump to Answer

Comments

Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Jun 3 2013
Added on May 5 2013
6 comments
4,849 views