posted 13 years ago
That position is called the "caret" in Swing. And you can add a CaretListener to a Swing text component to keep track of where the caret is located.
However that doesn't give you row and column locations; this is mainly (I think) because text components aren't normally designed to have rows and columns. They are normally designed to contain a continuous stream of text instead. Rows and columns can be changed by choosing a new font, or by changing the size of the component, or probably in other ways as well. So converting the caret location to row and column positions is going to be a difficult task.