Example usage for java.awt Canvas removeMouseMotionListener

List of usage examples for java.awt Canvas removeMouseMotionListener

Introduction

In this page you can find the example usage for java.awt Canvas removeMouseMotionListener.

Prototype

public synchronized void removeMouseMotionListener(MouseMotionListener l) 

Source Link

Document

Removes the specified mouse motion listener so that it no longer receives mouse motion events from this component.

Usage

From source file:Main.java

public static void removeListenerMouse(Class clazz, Canvas canvas) {
    for (Object event : canvas.getListeners(clazz)) {
        if (clazz == MouseListener.class) {
            canvas.removeMouseListener((MouseListener) event);
        } else {/*  ww w. ja va2s.  c o  m*/
            if (clazz == MouseMotionListener.class) {
                canvas.removeMouseMotionListener((MouseMotionListener) event);
            }
        }
    }
}