Select fragment of a text in JTextArea
I need to sel开发者_运维问答ect some fragment of a text in JTextArea. How should i do that?...
Use setCaretPosition(selectionStart)
followed by moveCaretPosition(selectionEnd)
. This is documented in JTextComponent's javadoc
精彩评论