(1)事件源
任何组件上都可以发生鼠标事件
鼠标进入组件、退出组件、在组件上方按下、松开、点击鼠标。
拖动鼠标、运动鼠标等都触发鼠标事件。
(2)监视器
addMouseListener(MouseListener listener)
addMouseMotionListener(MouseMotionListener listener)
(3)处理事件的接口
MouseListener接口(有5个方法)
mousePressed(MouseEvent)
mouseReleased(MouseEvent)
mouseEntered(MouseEvent)
mouseExited(MouseEvent)
mouseClicked(MouseEvent)
MouseMotionListener接口(有2个方法)
mouseDragged(MouseEvent)
mouseMoved(MouseEvent)