Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

4 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

โŒจ๏ธ Typing Speed Test - Java

A modern desktop Typing Speed Test application built using Java Swing that measures typing speed, accuracy, mistakes, errors, and overall performance in real time.

The application includes multiple difficulty levels, configurable test durations, live character highlighting, personal-best tracking, persistent typing history, and an analytics dashboard for monitoring improvement over time.


๐Ÿš€ Features

โŒจ๏ธ Real-Time Typing Test

  • Real-time typing analysis
  • Automatic timer start when typing begins
  • Live Net WPM calculation
  • Live Gross WPM calculation
  • Real-time accuracy calculation
  • Error detection
  • Mistake tracking
  • Corrected mistake tracking
  • Current passage progress indicator

๐ŸŽจ Character Highlighting

Characters in the reference passage are highlighted dynamically:

  • ๐ŸŸข Green โ€” correctly typed character
  • ๐Ÿ”ด Red โ€” incorrectly typed character
  • ๐ŸŸฃ Highlighted โ€” current character to type
  • โšช Grey โ€” characters not typed yet

This gives immediate visual feedback while typing.

๐ŸŽฏ Difficulty Levels

The application provides three difficulty modes:

  • Easy
  • Medium
  • Hard

Each difficulty level uses passages appropriate to its complexity.

โฑ๏ธ Test Durations

Users can choose between:

  • 15 seconds
  • 30 seconds
  • 60 seconds
  • 120 seconds

The selected duration is used when calculating final typing performance.

๐Ÿ”„ Automatic Passage Switching

If a user finishes the current passage before the timer expires:

  1. The current passage statistics are recorded.
  2. A new random passage is generated.
  3. The typing area is cleared.
  4. The test continues without resetting the timer.

This allows continuous typing during longer tests.

๐Ÿ“Š Performance Statistics

The application tracks:

Metric Description
Net WPM Typing speed based on correctly typed characters
Gross WPM Typing speed based on total typed characters
Accuracy Percentage of correctly typed characters
Errors Incorrect characters currently present
Mistakes Total typing mistakes made
Corrected Mistakes Mistakes corrected using deletion/backspace
Characters Total characters typed
Passages Number of completed passages

๐Ÿ“ˆ Analytics Dashboard

The application includes a dedicated analytics screen for tracking typing performance over time.

The dashboard displays:

  • Total tests completed
  • Average WPM
  • Best WPM
  • Average accuracy
  • Recent typing attempts
  • WPM progress graph

The graph displays recent test results and makes it easier to observe typing-speed improvement.


๐Ÿ† Personal Best Tracking

The application stores personal records including:

  • Best Net WPM
  • Best Accuracy
  • Total Tests Completed

Personal best statistics are stored using the Java Preferences API.

Records are maintained separately for different test durations.


๐Ÿ’พ Typing History

Completed typing tests are stored locally so previous results can be viewed later.

Each test result contains information such as:

  • Date and time
  • Difficulty
  • Test duration
  • Net WPM
  • Gross WPM
  • Accuracy
  • Mistakes
  • Corrected mistakes
  • Errors
  • Characters typed
  • Completed passages

The application can also clear stored typing history directly from the Analytics screen.


๐Ÿงฎ WPM Calculation

A standard typing word is considered to contain approximately 5 characters.

Gross WPM

Gross WPM = (Total Characters Typed / 5) / Time in Minutes

Net WPM

This project calculates Net WPM using correctly typed characters:

Net WPM = (Correct Characters / 5) / Time in Minutes

Accuracy

Accuracy = (Correct Characters / Total Characters Typed) ร— 100

๐Ÿ› ๏ธ Technologies Used

  • Java
  • Java Swing
  • Java AWT
  • Swing Timer
  • StyledDocument
  • DocumentListener
  • DocumentFilter
  • Java Preferences API
  • File handling
  • CSV-based local history storage
  • Git
  • GitHub

๐Ÿ“ Project Structure

TypingSpeedTest/
โ”‚
โ”œโ”€โ”€ TypingSpeedTest.java
โ”œโ”€โ”€ TypingCalculator.java
โ”œโ”€โ”€ PassageManager.java
โ”œโ”€โ”€ TestResult.java
โ”œโ”€โ”€ HistoryManager.java
โ”œโ”€โ”€ .gitignore
โ””โ”€โ”€ README.md

TypingSpeedTest.java

Main application class responsible for:

  • Graphical user interface
  • Typing test logic
  • Timer
  • Navigation
  • Live statistics
  • Passage highlighting
  • Result screen
  • Analytics dashboard
  • Keyboard shortcuts
  • Personal-best management

TypingCalculator.java

Handles typing-related calculations such as:

  • Correct character counting
  • Error counting
  • Accuracy
  • Gross WPM
  • Net WPM
  • Progress percentage
  • Performance ratings

PassageManager.java

Responsible for:

  • Managing typing passages
  • Difficulty-based passages
  • Random passage selection
  • Word counting

TestResult.java

Represents an individual typing-test result and stores its associated statistics.

HistoryManager.java

Handles persistent typing history, including:

  • Saving test results
  • Loading previous results
  • Clearing history
  • Local CSV data management

โ–ถ๏ธ How to Run

Requirements

Make sure the Java Development Kit (JDK) is installed.

Check your Java installation:

java -version

Check the Java compiler:

javac -version

1. Clone the Repository

git clone https://github.com/vanshantil/Typing-Speed-Test-Java.git

2. Enter the Project Directory

cd Typing-Speed-Test-Java

3. Compile the Java Files

javac *.java

4. Run the Application

java TypingSpeedTest

The Typing Speed Test window should now open.


โŒจ๏ธ Keyboard Shortcuts

Shortcut Action
Ctrl/Cmd + R Restart current test
Ctrl/Cmd + N Start a new test

The shortcuts work on both Windows/Linux and macOS using the operating system's standard menu shortcut key.


๐Ÿ–ฅ๏ธ Application Workflow

Launch Application
        โ†“
Select Difficulty
        โ†“
Select Test Duration
        โ†“
Start Typing
        โ†“
Timer Starts Automatically
        โ†“
Real-Time Statistics Update
        โ†“
Passage Completed?
     โ†™       โ†˜
   Yes        No
    โ†“          โ†“
Load New    Continue
Passage     Typing
     โ†˜       โ†™
      Timer Ends
          โ†“
   Calculate Results
          โ†“
     Save History
          โ†“
Update Personal Records
          โ†“
    Results Screen
          โ†“
 Analytics Dashboard

๐ŸŽจ User Interface

The application uses a custom dark interface built entirely with Java Swing.

The interface includes:

  • Dark themed dashboard
  • Statistic cards
  • Styled buttons
  • Hover effects
  • Progress bars
  • Dynamic text highlighting
  • Results dashboard
  • Analytics tables
  • Custom WPM graph

๐Ÿง  Java Concepts Demonstrated

This project demonstrates several important Java and Object-Oriented Programming concepts:

  • Classes and objects
  • Encapsulation
  • Object-oriented design
  • Event-driven programming
  • Inner classes
  • Inheritance
  • Method overriding
  • Java Collections
  • Exception handling
  • File handling
  • GUI development
  • Swing components
  • Event listeners
  • Document listeners
  • Document filters
  • Java Preferences API
  • Custom painting with Graphics2D

๐Ÿ”’ Generated Files

Runtime and compiled files are intentionally excluded from Git using .gitignore.

Examples include:

*.class
typing_history.csv
.DS_Store
.vscode/
.idea/

This keeps the repository clean and ensures only source code and project documentation are version controlled.


๐Ÿ”ฎ Future Improvements

Possible future additions include:

  • User accounts and profiles
  • More typing passages
  • Custom passage mode
  • Words-only typing mode
  • Punctuation mode
  • Numbers mode
  • Accuracy graph
  • Mistakes heatmap
  • Typing consistency measurement
  • WPM comparison between difficulty levels
  • Daily typing goals
  • Typing streak tracking
  • Exportable performance reports
  • Database-based history
  • Online leaderboard
  • Sound effects
  • Additional themes
  • Light mode
  • Packaging as an executable JAR

๐ŸŽ“ Learning Outcomes

Building this project provides practical experience with:

  • Java application development
  • Object-Oriented Programming
  • Desktop GUI development
  • Event-driven programming
  • Data persistence
  • Real-time calculations
  • Custom Swing rendering
  • File management
  • Application state management
  • Git version control
  • GitHub project management

๐Ÿ‘จโ€๐Ÿ’ป Author

Vansh Antil

B.Tech Computer Science Engineering
AI & Data Science


โญ Support

If you find this project useful, consider giving the repository a star โญ.

Contributions, suggestions, and improvements are welcome.

About

A modern Java Swing typing speed test application featuring real-time WPM calculation, accuracy tracking, mistake detection, multiple difficulty levels, performance analytics, typing history, and personal best records.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages