Re: Swing Text components



On Mar 31, 5:28 pm, "Uncle Sam" <sameervijay...@xxxxxxxxx> wrote:
Sorry for the incorrectly formatted program. I'll keep that in mind
for my next post.

Music to my ears..

That aside, here's another query.

...but note that this new query would be best
put under a new title. (checks current tile)
No, I take that back - I will change the advice
to 'each thread should ideally have a clear and
specific title'! For the first, perhaps..
'Focus owner is Swing text components'
...and for this one..
'Cursor index in Swing text components'
...but I will continue it here, for the sake
of brevity (+ the fact your current vague
title, suits each, equally well!).

...I now know what text field has the
focus but is there some method that returns the index of the cursor
location so that I can paste the clipboard contents in the proper
location inside the text field?

The magic word here is 'caret', if you look
through the JavaDocs for methods related to
the caret, you will find the answer.

Andrew T.

.