e647. 处理鼠标移动事件

    
component.addMouseMotionListener(new MyMouseMotionListener());
    
    public class MyMouseMotionListener extends MouseMotionAdapter {
        public void mouseMoved(MouseEvent evt) {
            // Process current position of cursor while all mouse buttons are up.
            process(evt.getPoint());
        }
        public void mouseDragged(MouseEvent evt) {
            // Process current position of cursor while mouse button is pressed.
            process(evt.getPoint());
        }
    }

 

Related Examples

e647. 处理鼠标移动事件

上一篇:CTO要不要写代码


下一篇:301和302跳转