Получить курсор в Textarea Java

int currentCaretPosition = textPane.getCaretPosition();
Strange Seahorse