> Hi all,
>
> I'm searching a way to find the length of the text in a JTextPane
> before/after the current "getVisibleRect()" . Is there any easy way to
> achieve this ?
You could approximate it by getting a FontMetrics object, finding the
average width of the character, and multiplying that by the length of your
string.
Or you could directly try rendering the string onto an offscreen buffer
and directly measure the enclosing box to get a more accurate value.
- Oliver
> I'm searching a way to find the length of the text in a JTextPane
> before/after the current "getVisibleRect()" . Is there any easy way to
> achieve this ?
viewToModel