Obtenha a posição do cursor na textarea java
int currentCaretPosition = textPane.getCaretPosition();
Strange Seahorse
int currentCaretPosition = textPane.getCaretPosition();