Uzyskaj pozycję kursora w TextArea Java

int currentCaretPosition = textPane.getCaretPosition();
Strange Seahorse