Hi,
You can translate the caret position:
Rectangle caretRectangle =
myTextPane.getUI().modelToView(myTextPanepane, myTextPanepane.getCaretPosition());
The
caretRectangle
will then hold the
(x, y) for the lower part and the upper part of the caret in pixels.
Hope this helps,
Fredrik