From 372d97fee538f86c8333fbbde43cf51484b8ac67 Mon Sep 17 00:00:00 2001 From: sowgro Date: Sat, 6 May 2023 14:56:46 -0400 Subject: Add JavaFX and seperate source and class files --- src/main/KeyDetection.java | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 src/main/KeyDetection.java (limited to 'src/main/KeyDetection.java') diff --git a/src/main/KeyDetection.java b/src/main/KeyDetection.java new file mode 100644 index 0000000..7887405 --- /dev/null +++ b/src/main/KeyDetection.java @@ -0,0 +1,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); + } + +} -- cgit v1.2.3