title: How do you get the selected character position in a JTextArea?
body: <p>Here is a challenging question!</p>
  
  <p>Let me first tell you my scenario how am i implementing a solution to a problem.</p>
  
  <p>I am reading a log file and displaying it on the JTextArea. Log file is cp037 character coded. I was reading each file as a byte stream or byte array from the log file &amp; displaying it. Anyways, i managed to display the text properly in JTextArea by cp037 character coding. </p>
  
  <p>Now, User may select a set of characters in the JTextArea. All i want is the position of first character of the user's selected text, from a nearest special character '+'(its character code in cp037 is 4E), which is prior to the selected text. This character may occur at several places in the JTextArea.</p>
  
  <p>In simple sentence, i want the first character location(of user selected text) from nearset '+' which should be occuring prior to the user's selected text. </p>
  
  <p>PS: cp037 is a type of character encoding  scheme which is created by IBM &amp; used for IBM Mainframes.</p>
  
  <p>Please fell free to ask me if the question is not clear...:-></p>