Getting the first and last index values of highlighted text in a JTextArea
<p>I am writing a text editor(in java) where I am using a JTextArea for the main text editing and I am putting the text into a stringbuilder. </p>

<p>When I highlight the text and do something like delete that block of text, I want it to update in the stringbuilder.</p>

<p>So my question is, is there a way to get the first and last index of the highlighted text in the stringbuilder?</p>

<p>Thanks.</p>
