I have a JeditorPane which has some text in HTML format. When I execute the following command
int len = editorPane.getText().length();
The value for len is 7473. But then I try to do the following:
editorPane.setCaretPosition(4995);
And I get the following exception: java.lang.IllegalArgumentException: bad position: 4995
My understanding is that I should only get this exception if the position at which I'm trying to set the caret is less than 0 or greater than the text length. It is neither. How can this be.
Thank you,
Elliott