hello all
I have one textField and one textArea.
How to move the cursor to the end of Text of TextArea
when
-cursor is in textField,and keyboard [Enter] pressed
thank you
denny
hello all
I have one textField and one textArea.
How to move the cursor to the end of Text of TextArea
when
-cursor is in textField,and keyboard [Enter] pressed
thank you
denny
Read the tutorial and API doc about how focus works:
http://download.oracle.com/javase/tutorial/uiswing/misc/focus.html
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
myTextArea.setCaretPosition(textArea.getDocument().getLength());
big thanks for all of you
denny
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.