aboutsummaryrefslogtreecommitdiff
path: root/src/test/KeyDetection.java
blob: 447b1017bbee4cb6d236c0860c028e1a879f1ca0 (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
/*Name:	
 *Date:
 *Period:
 *Teacher:
 *Description:
 */
package test;

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);
    }
    
}