List of usage examples for java.awt Canvas getListeners
@SuppressWarnings("unchecked") public <T extends EventListener> T[] getListeners(Class<T> listenerType)
FooListener
s upon this Component . 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 {/* w w w . j a v a2s. c o m*/ if (clazz == MouseMotionListener.class) { canvas.removeMouseMotionListener((MouseMotionListener) event); } } } }