title: Using a JTextPane, consumed mouse events still propagate to caret updates/selection updates
body: <p>I seem to be having a problem with JTextPane. I have extended JTextPane to render a floating image because the JTextPane icon functionality does not suit my purpose. I want the user to be able to click on the image, and have certain events performed. However, when I click on the image, even when I use evt.consume(), the caret and selection are updated in the JTextPane. I would like clicks and mouse events in general that interact with the image to not affect the caret position or selection at all. Relevant code:</p>
  
  <pre><code>public class JTextPaneImg extends JTextPane {
  
      public JTextPaneImg(){
          super();
          addMouseListener(new java.awt.event.MouseAdapter() {
              public void mousePressed(java.awt.event.MouseEvent evt) {
                  formMousePressed(evt);
              }
              public void mouseReleased(java.awt.event.MouseEvent evt) {
                  formMouseReleased(evt);
              }
          });
      }
  
      private void formMousePressed(java.awt.event.MouseEvent evt) {                                  
          if (imgBound.contains(evt.getPoint())) {
               evt.consume();
               //Do some stuff in here to interact with the image
               // but the event still undesirably interacts with selection/caret
          }
      }   
  
  
      private void formMouseReleased(java.awt.event.MouseEvent evt) {                                  
          if (imgBound.contains(evt.getPoint())) {
               evt.consume();
               //Do some stuff in here to interact with the image
               // but the event still undesirably interacts with selection/caret
          }
      }   
  }
  </code></pre>
  
  <p>I have even called getMouseListeners and verified that my own mouse listener is the last in the array, I read that listeners are called from highest to lowest index, meaning if my listener calls consume, it should be the last to act on the event. Why is my mouse click event still updating the caret then? Is this a problem with the Look and Feel?</p>