blob: 7887405f039386ba3d5e7da4611ed2d0b40034aa (
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 main;
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);
}
}
|