A modern Words Per Minute (WPM) typing test desktop application built with Java (Swing). Tracks live WPM and accuracy, highlights mistakes, saves session history, and visualizes performance with charts. Passages can be loaded from an external file so each session can use long, varied text.
- Live WPM and accuracy updating in real time
- Error highlighting with correct characters in green and mistakes in red
- Countdown timer default 60 seconds, configurable in code or UI
- Session history saved to
results.csvwith timestamp, WPM, accuracy, and errors - View history table and performance charts using JFreeChart
- External passages loaded from
passages.txtin classpath or working directory - Input placeholder that appears when the input is empty
- Java 17 or newer installed and
JAVA_HOMEset - IntelliJ IDEA Community or Ultimate recommended
- Gradle optional — the project can use the Gradle wrapper
- Add these dependencies to
build.gradleif not present:repositories { mavenCentral() } dependencies { implementation 'org.jfree:jfreechart:1.5.4' // charts implementation 'com.formdev:flatlaf:2.6' // optional modern look and feel }
1. Clone the repository
git clone https://github.com/SatishGautam1/Typing-Test.git
cd Typing-Test2. Open in IntelliJ IDEA
- Launch IntelliJ IDEA.
- Go to File → Open... and select the project root folder (Typing-Test).
- IntelliJ will detect the Gradle build file (build.gradle) and import dependencies automatically.
- Ensure the Project SDK is set to Java 17 or newer: File → Project Structure → Project → Project SDK → select JDK 17+.
3. Build the project
- From IntelliJ: Build → Build Project.
- From command line (Gradle wrapper):
./gradlew clean build4. Run the project
- In IntelliJ: Open
com.nighttech.typingtest.ui.TypingTestApp. - Click the green Run icon next to the
mainmethod. - From command line:
./gradlew runOr run the JAR directly:
java -jar build/libs/typing-test-1.0.0-all.jarTyping-Test/
├─ build.gradle
├─ settings.gradle
├─ src/
│ ├─ main/
│ │ ├─ java/com/nighttech/typingtest/
│ │ │ ├─ model/ # SessionState, ResultRecord
│ │ │ ├─ service/ # TypingSessionService, HistoryRepository
│ │ │ ├─ ui/ # TypingTestApp (Swing UI)
│ │ │ └─ util/ # StatsCalculator
│ │ └─ resources/
│ │ └─ passages.txt # optional resource file with passages
└─ README.md
- Place
passages.txtinsrc/main/resources/or in the working directory. - Separate passages with blank lines. Example:
The quick brown fox jumps over the lazy dog.
Here is a longer passage that spans multiple sentences and is intended for practice.
Another passage for variety.passages.txtnot found → Ensure the file is insrc/main/resources/or the working directory.- Empty passages list → Passages must be separated by blank lines.
- Dependencies not resolved → Re-import Gradle project in IntelliJ (View → Tool Windows → Gradle → Refresh).
- Charts not displaying → Confirm
org.jfree:jfreechartis on the classpath. - Placeholder not visible → Ensure you are running the latest build; placeholder appears when input is empty.
MIT License — feel free to use, modify, and share.