Obtenez la position du curseur dans TextArea Java

int currentCaretPosition = textPane.getCaretPosition();
Strange Seahorse