--start--
Sample code:
int i = textfield.getText().length();
textfield.setSelectionStart(0);
textfield.setSelectionEnd(i);
Put this in the action or wherever you want it. Replace textfield variable to the name of your textfield. I'm not sure but this might work for JTextArea and JTextPane too.
--end---
0 comments:
Post a Comment