title: JEditorPane unexpected behavior with new lines
body: <p>I am trying to highlight text in a <code>JEditorPane</code> text field and save the index of the selected text. However I keep running into problems when I save the selections. The JEditorPane seems to save new lines in a different way each time. It will write a <code>"\n"</code>, a <code>"\r"</code> and sometimes even a <code>"\r\n"</code> when the user presses the enter key. And sometimes the JEditorPane will even ignore carriage returns which causes wrong selection indices.</p>
  
  <p>Is it possible to get a consistent behavior when the user presses the enter key?</p>