title: displaying links in java's JTextPane without html
body: <p>I need to take text from a source as plain text and display it in a JTextPane or JEditorPane. The source text is not HTML but will contain URLs between square brackets which need to be displayed and function as hyperlinks.</p>
  
  <p>I've considered setting the pane's content type to text/html and surounding the url in html tags but that ends up ignoring the newline characters, which is a bad thing, and i'm not sure how to go about replacing newline characters with "<code>&lt;br/&gt;</code>". Is there an easy wat to do that?</p>
  
  <p>If doing that means scanning through the whole string wouldn't it be better to just customize how the text is displayed?</p>
  
  <p>So I've also considered the route that involves making my own EditorKit like starturtle mentions in <a href="http://forums.sun.com/thread.jspa?threadID=246223&amp;tstart=32326" rel="nofollow noreferrer">this thread</a>, but he doesn't explain how to do it. I've looked over the code in <a href="http://java.sun.com/products/jfc/tsc/articles/text/editor_kit/" rel="nofollow noreferrer">this article</a>, but it seems like a lot of work, is this the route I should take?</p>
  
  <p>Has anyone ever done this. Any recommendations? Is it better to convert to html or to customize the display?</p>