aboutsummaryrefslogtreecommitdiff
path: root/KeyDetection.java
blob: 98f96e4b01a0d004c2ae42b51764775d896eae32 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/*Name:	
 *Date:
 *Period:
 *Teacher:
 *Description:
 */
package cs;

import javax.swing.*;
import java.awt.event.ActionEvent;

public class KeyDetection extends AbstractAction
{
    long timeStart = System.currentTimeMillis();
    private char key;
    public KeyDetection(char ch){
        key = ch;
    }
    
    public void actionPerformed(ActionEvent e)
    {
        // TODO Auto-generated method stub
        int time = (int)((System.currentTimeMillis()-timeStart));
        System.out.println(key + ": " + time);
        
    }
    
}