Obtaining line & column in JEditorPane

I want to write an editor using JEditorPane. I know how to obtain caret position. But I would like to obtain current line & column where the caret is. Is there some simple method to do this, without  keeping and updating "by hand" a table of begins of lines?
rainetteAsked:
Who is Participating?
 
rainetteAuthor Commented:
To objects: thank you, but the article in your link doesn't respond to my problem. I don't want to add line number to every line displayed. Instead I want to track a caret movement and "translate" its position into line/column displayed in "status line".
To do this I could build a table od lines beginnings and search it everytime when the caret position changes. But  in a case of "true" editing action, i.e. inserting or deleting I have to rebuild that table i.e. to rescan  the whole document. For example I have to do it after every character typing. And my problem is: how could I do this "translation" without superfluous waste of time ?
0
 
objectsCommented:
There is no simple way that I'm aware of, shouldn't the link I posted above help based on it needs to determine the line number to display it?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.