Select a piece of text in JTextArea

I need to select a piece of text in JTextArea. How can I do it?...

+4
source share
1 answer

Use setCaretPosition(selectionStart) and then moveCaretPosition(selectionEnd) . This is described in the JTextComponent javadoc

+3
source

All Articles