Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: LGPL 

import java.awt.*;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;

public class Main {
    public static void removeListenerMouse(Class clazz, Canvas canvas) {
        for (Object event : canvas.getListeners(clazz)) {
            if (clazz == MouseListener.class) {
                canvas.removeMouseListener((MouseListener) event);
            } else {
                if (clazz == MouseMotionListener.class) {
                    canvas.removeMouseMotionListener((MouseMotionListener) event);
                }
            }
        }
    }
}