Get the screen position for the caret in JEditorPane

S

Stefan Istrate

I have a JEditorPane in which I am writing text. How can I get the
position on the screen were a character is inserted? I want to use
this position to display there a popup window.

Thanks,
Stefan
 
T

TiloVillwock

I have a JEditorPane in which I am writing text. How can I get the
position on the screen were a character is inserted? I want to use
this position to display there a popup window.

Thanks,
Stefan

That's a tricky one. I guess you could try to locate the position by
measuring the font size with the FontMetrics class, though this
definately not the easiest approach.

Tilo
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top