title: EventListener Freezing (Java)
body: <p>Alright so, my issue is that the mouseMoved is frozen when you drag the mouse, which is one of the methods in MouseMotionListener ( mouseMoved, and mouseDragged ). I think maybe the mouseDragged is freezing mouseMoved, if anyone can help me so that it doesn't do that, that would be greatly wonderful.</p>
  
  <pre><code>import javax.swing.JFrame;
  import java.awt.Graphics;
  import java.awt.Image;
  import java.awt.event.MouseMotionListener;
  import java.awt.event.MouseEvent;
  import java.awt.Rectangle;
  import java.lang.Runnable;
  import java.awt.RenderingHints;
  import java.awt.Graphics2D;
  import java.awt.Color;
  
  public class Window extends JFrame implements MouseMotionListener, Runnable {
      protected static int xWindow = 640;
      protected static int yWindow = 480;
      private Image dbi;
      private Graphics dbg;
      private int xMouse;
      private int yMouse;
  
      public void paint( Graphics g ) {
          dbi = createImage( getWidth(), getHeight() );
          dbg = dbi.getGraphics();
          paintComponent( dbg );
          g.drawImage( dbi, 0, 0, this );
      }
  
      public void paintComponent( Graphics g ) {
          Graphics2D g2d = ( Graphics2D ) g;
          g2d.setRenderingHint( RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON );
          g2d.setColor( Color.RED );
          g2d.drawString( "Mouse X: " + xMouse + " | Y: " + yMouse, 15, 40 );
  
          repaint();
      }
  
      public void mouseDragged( MouseEvent e ) {
          e.consume();
      }
  
      public void mouseMoved( MouseEvent e ) {
          xMouse = e.getX();
          yMouse = e.getY();
          e.consume();
      }
  
      public void run() {
          while ( true ) {
              try {
                  Thread.sleep( 1 );
              } catch( Exception e ) {
                  e.printStackTrace();
              }
          }
      }
  
  }
  </code></pre>