title: Jittering when trying to move undercorated JFrame
body: <p>I have made a custome <code>JFrame</code> called <code>mainWindow</code> that is undecorated. I have added a <code>JLabel</code> named <code>dragBar</code> at the top of it and gave it desired dimensions (as shown below). When I click on the label I make the window move according to my mouse by using two listeners; one <code>MouseListener</code> and one <code>MouseMotionListener</code>.<br>
  The problem is that whenever I click on the label the window does move according to my mouse's location but it spazzes all over my screen until I stop moving the mouse or let go of the click button.<br>
  Is my method wrong? What is causing this issue?
  Here is my code:  </p>
  
  <pre><code>    //what i use to make the dragBar
      private JLabel dragBar = new JLabel();
      private Point initialClick; //the initial point where I click on the label
      //my mainWindow JFrame
      private JFrame mainWindow = new JFrame();
      private Dimension mainWindowSize = new Dimension(680,410);
  
      //the code I use to set up my mainWindow JFrame
      mainWindow.setUndecorated(true);
      mainWindow.setShape(new RoundRectangle2D.Double(0, 0, 670, 400, 5, 5));
      mainWindow.setSize(mainWindowSize);
      mainWindow.setMinimumSize(mainWindowSize);
      mainWindow.setResizable(false);
      mainWindow.setLocation((screen_size.width/2)- mainWindow.getWidth()/2, (screen_size.height/2)- mainWindow.getHeight()/2);
      mainWindow.getContentPane().setBackground(new Color(46, 48, 50, 255));
  
      //the code I use to set up my dragBar label
      topContainer.add(dragBar,3); //a Jlayeredpane that contains the dragBar label and is added to the mainWindow
      dragBar.setSize(topContainer.getSize());
      dragBar.setLocation(0,0);
      dragBar.addMouseListener(new MouseListener() {
          @Override public void mouseClicked(MouseEvent e) {}
          @Override
          public void mousePressed(MouseEvent e) {
              initialClick = e.getPoint();
          }
          @Override public void mouseReleased(MouseEvent e) {}
          @Override public void mouseEntered(MouseEvent e) {}
          @Override public void mouseExited(MouseEvent e) {}
      });
      dragBar.addMouseMotionListener(new MouseMotionListener() {
          @Override
          public void mouseDragged(MouseEvent e) {
              int changeX = e.getX()-initialClick.x;
              int changeY = e.getY()-initialClick.y;
  
              mainWindow.setLocation(mainWindow.getX()+changeX, mainWindow.getY()+changeY);
          }
          @Override public void mouseMoved(MouseEvent e) {}
      });
  </code></pre>