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

Forum statistics

Threads
474,001
Messages
2,570,255
Members
46,853
Latest member
GeorgiaSta

Latest Threads

Top