/** Invoked when a mouse button has been pressed on a component. */ public void mousePressed(MouseEvent e) { timer = new Timer(DELAY, new TimeListener(e)); timer.start(); }
/** Invoked when a mouse button has been released on a component. */ public void mouseReleased(MouseEvent e) { if (timer != null) { timer.stop(); } }