鼠标移动会调用MouseMotionListener的mouseMoved(MouseEvent e)方法,你在这个方法中e.getX(),e.getY()就可以得到鼠标的位置