hello all

I have one textField and one textArea.
How to move the cursor to the end of Text of TextArea
-cursor is in textField,and keyboard [Enter] pressed

thank you

Recommended Answers

All 4 Replies

My suggestion:

1. Add ActionListener to textField.
2. When actionPerformed(), move the cursor to textArea using textArea.grabFocus().
3. If you want to place the cursor at the end of the text of textArea, use select() method.

you can use Focus, but for JTextComponent is there DocumentListener + Caret for JTextArea


big thanks for all of you

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.