code: private MouseListener createMouseListener() {
          return new MouseAdapter() {
              @Override
              public void mousePressed(MouseEvent e) {
                  Point clickPoint = new Point(e.getPoint());
  
                  SwingUtilities.convertPointToScreen(clickPoint, fComponent);
  
                  dX = clickPoint.x - fWindow.getX();
                  dY = clickPoint.y - fWindow.getY();
              }
          };
      }
docs: Create the mouse listener.
  
  @return the mouse listener.