title: HyperLinkListener not triggering - java swing
body: <p>I'm trying to implement a JEditorPane with hyperlinks. I'm using a HyperLinkListener but it seems to never trigger.</p>
  
  <p>Code:</p>
  
  <pre><code>JEditorPane editorPane = new JEditorPane("text/html", programInfo);
  
  editorPane.addHyperlinkListener(e -&gt; {
      System.out.println("CLICK");
      if (e.getEventType().equals(HyperlinkEvent.EventType.ENTERED))
          try {
              if (Desktop.isDesktopSupported()) {
                  Desktop.getDesktop().browse(e.getURL().toURI());
                  }
          } catch (IOException e1) {
              e1.printStackTrace();
          } catch (URISyntaxException e1) {
              e1.printStackTrace();
          }
      });
  
  JOptionPane.showMessageDialog(contentPane, editorPane);
  </code></pre>
  
  <p>Sample HTML:</p>
  
  <pre><code> &lt;body&gt;
   &lt;p&gt;&lt;b&gt;Author:&lt;/b&gt; James - &lt;a href="http://www.sample.co.uk"&gt;sample&lt;/a&gt;&lt;/p&gt;
   &lt;/body&gt;
  </code></pre>
  
  <p>This leads to this:</p>
  
  <p><img src="https://i.stack.imgur.com/6lVgp.png" alt="Imgur upload of JEditorPane"></p>
  
  <p>But when I click on the links nothing happens.</p>
  
  <p><strong>Additional Info:</strong></p>
  
  <p>I'm testing this on Ubuntu 14.04.
  I have set Look and Feel to system.</p>