my offsets are all wrong in my jtextpane got few questions.
posted 7 years ago
So, i have an html page i run a regex on find a match then save the html page as string (already is one ) and get the offsets of the match.
Then i add the html text to the jtextpane with .settext() and get the highlighter and highlight with the offsets used from my regex from the raw string match.
I have done some testing and have found the length of the jtextpane.gettext() is larger then the string i set it with. This is my issue i can see that. I just cant seem to figure out what the extra stuff is and how to get these to to be same length so my offsets lineup.
I thought the jtextpane would be smaller because i thought it stripped \r. Very strange any ideas what extra stuff might be and how i can get the string i set it with and the gettext() to be same?