Hello!
> I want to set the CaretPosition right where the component (JButton) is
> in JTextPane (textPane).
[quoted text clipped - 9 lines]
> is on the first line - even this fails sometimes - and never works when
> it's elsewhere (anywhere below).
MouseEvent points are in the coordinate system of their component.
Use SwingUtilities.convertPoint to convert from JButton to JTextPane
coordinate system.
Christian

Signature
The cat in the hat came back, wrecked a lot of havoc on the way
Always had a smile and a reason to pretend
R.E.M., The Sidewinder Sleeps Tonight
VI - 19 Mar 2004 15:55 GMT
> Hello!
>
[quoted text clipped - 18 lines]
>
> Christian
After making the mentioned change and an amendment to the above code I
got what I required.
Thanks a lot for your help. You really are a Swing expert!
Regards
VI