posted 12 years ago
Hi.
Is it possible to have selection in JTextField and cursor position at the beginning of this selection?
I tried this
textField.setCaretPosition(start);
textField.select(start, end);
- it moves cursor at the end of the selection.
And this
textField.select(start, end);
textField.setCaretPosition(start);
sets the cursor right, but clears the selection.
Am I doing something wrong? Thanks