Here you can find the source of isDoubleClick(MouseEvent evt)
MouseEvent
is a double-click.
Parameter | Description |
---|---|
evt | the <code>MouseEvent</code> |
public static boolean isDoubleClick(MouseEvent evt)
//package com.java2s; //License from project: Open Source License import java.awt.event.MouseEvent; import javax.swing.SwingUtilities; public class Main { /**//from ww w . ja v a 2 s. c om * Checks if <code>MouseEvent</code> is a double-click. * @param evt the <code>MouseEvent</code> * @return true if event represents a double-click, false if not */ public static boolean isDoubleClick(MouseEvent evt) { return (SwingUtilities.isLeftMouseButton(evt) && evt.getClickCount() == 2); } }