diff options
Diffstat (limited to 'KeyDetection.java')
-rw-r--r-- | KeyDetection.java | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/KeyDetection.java b/KeyDetection.java new file mode 100644 index 0000000..98f96e4 --- /dev/null +++ b/KeyDetection.java @@ -0,0 +1,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); + + } + +} |