Example usage for javax.swing AbstractButton setMultiClickThreshhold

List of usage examples for javax.swing AbstractButton setMultiClickThreshhold

Introduction

In this page you can find the example usage for javax.swing AbstractButton setMultiClickThreshhold.

Prototype

public void setMultiClickThreshhold(long threshhold) 

Source Link

Document

Sets the amount of time (in milliseconds) required between mouse press events for the button to generate the corresponding action events.

Usage

From source file:MultiClickThreshholdDemo.java

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");
        }/*ww w .  j a v a 2 s . co m*/
    });

    frame.add(bn);

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