MultiClickThreshholdDemo.java Source code

Java tutorial

Introduction

Here is the source code for MultiClickThreshholdDemo.java

Source

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.AbstractButton;
import javax.swing.JButton;
import javax.swing.JFrame;

public class MultiClickThreshholdDemo {

    public static void main(String[] a) {
        JFrame frame = new JFrame();
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

        AbstractButton bn = new JButton();
        bn.setMultiClickThreshhold(1000);

        bn.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                System.out.println("action");
            }
        });

        frame.add(bn);

        frame.setSize(300, 200);
        frame.setVisible(true);
    }
}