aboutsummaryrefslogtreecommitdiff
path: root/apcs/KeyDetection.java
diff options
context:
space:
mode:
Diffstat (limited to 'apcs/KeyDetection.java')
-rw-r--r--apcs/KeyDetection.java27
1 files changed, 27 insertions, 0 deletions
diff --git a/apcs/KeyDetection.java b/apcs/KeyDetection.java
new file mode 100644
index 0000000..9fc9db6
--- /dev/null
+++ b/apcs/KeyDetection.java
@@ -0,0 +1,27 @@
+/*Name:
+ *Date:
+ *Period:
+ *Teacher:
+ *Description:
+ */
+package apcs;
+
+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);
+ }
+
+}