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 ( ) ; } } ; }
Create the mouse listener .