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:
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.
以上就是Setting the a caret in an JEditor Pane causes an exception.的详细内容，更多请关注web前端其它相关文章！