List of usage examples for java.awt Canvas removeMouseListener
public synchronized void removeMouseListener(MouseListener l)
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. j a va 2 s. c o m if (clazz == MouseMotionListener.class) { canvas.removeMouseMotionListener((MouseMotionListener) event); } } } }