Example usage for java.awt.event MouseListener interface-usage

List of usage examples for java.awt.event MouseListener interface-usage

Introduction

In this page you can find the example usage for java.awt.event MouseListener interface-usage.

Usage

From source file Main.java

public class Main extends JFrame implements MouseListener {
    public static void main(String[] args) {
        Main frame = new Main();
        frame.setVisible(true);
        frame.setSize(200, 200);
        frame.setExtendedState(JFrame.MAXIMIZED_BOTH);

From source file BezLab.java

public class BezLab extends Frame implements MouseListener, MouseMotionListener {

    private int[] xs = { 75, 150, 300, 375 };

    private int[] ys = { 250, 100, 350, 250 };

From source file SimpleDraw.java

public class SimpleDraw extends JFrame implements ActionListener, MouseListener {
    // (x1,y1) = coordinate of mouse pressed
    // (x2,y2) = coordinate of mouse released
    int x1;
    int y1;
    int x2;

From source file Test.java

class ApplicationWindow extends JFrame implements MouseListener, MouseWheelListener {

    public ApplicationWindow() {
        this.setSize(200, 100);
        this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        this.setLayout(new FlowLayout());

From source file Main.java

class MyTextArea extends JTextArea implements MouseListener {
    private Image myImage;

    public MyTextArea() {
        addMouseListener(this);
    }

From source file PopupDemo.java

public class PopupDemo extends Frame implements ActionListener, MouseListener {

    public static void main(String argv[]) {
        new PopupDemo().setVisible(true);
    }

From source file Main.java

class MouseMotionEvents extends JPanel implements MouseListener, MouseMotionListener {
    Point p;

    public MouseMotionEvents() {
        addMouseListener(this);
        addMouseMotionListener(this);

From source file MainClass.java

class MouseMotionEvents extends JPanel implements MouseListener, MouseMotionListener {
    Point p;

    public MouseMotionEvents() {
        addMouseListener(this);
        addMouseMotionListener(this);

From source file SaveYourDrawingToFile.java

public class SaveYourDrawingToFile extends JFrame implements MouseListener, ActionListener {
    List<Point> displayList = new ArrayList<Point>();
    String pathname = "data.dat";
    JButton clearBtn = new JButton("Clear");
    JButton saveBtn = new JButton("Save");
    JButton restoreBtn = new JButton("Restore");

From source file BufferedDraw.java

public class BufferedDraw extends JPanel implements MouseListener, MouseMotionListener {
    Rectangle rect = new Rectangle(0, 0, 100, 50);

    BufferedImage bi = new BufferedImage(5, 5, BufferedImage.TYPE_INT_RGB);

    Graphics2D big;