https://github.com/dawoodkhatri1/stopwatch-using-java-gui
A simple Java Swing application that displays a real-time clock and a stopwatch with start, stop, reset, and lap features. It maintains up to 10 recent lap times using a queue.
https://github.com/dawoodkhatri1/stopwatch-using-java-gui
clock educational-project gui java stopwatch swing timer
Last synced: about 1 year ago
JSON representation
A simple Java Swing application that displays a real-time clock and a stopwatch with start, stop, reset, and lap features. It maintains up to 10 recent lap times using a queue.
- Host: GitHub
- URL: https://github.com/dawoodkhatri1/stopwatch-using-java-gui
- Owner: dawoodkhatri1
- Created: 2025-04-19T15:01:46.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-04-19T15:18:07.000Z (about 1 year ago)
- Last Synced: 2025-04-19T19:05:12.450Z (about 1 year ago)
- Topics: clock, educational-project, gui, java, stopwatch, swing, timer
- Language: Java
- Homepage:
- Size: 8.79 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Stopwatch Application
A Java GUI application that combines a digital clock with a stopwatch featuring lap time functionality.
## Features
- **Digital Clock**: Displays current time in 24-hour format (HH:MM:SS)
- **Stopwatch**: Accurate to milliseconds (HH:MM:SS.mmm)
- **Lap Times**: Records up to 10 lap times with queue-based management
- **Controls**:
- Start/Pause stopwatch
- Reset stopwatch and lap times
- Record lap times while running
## Technical Details
- **Data Structures**: Uses Queue (LinkedList implementation) for efficient lap time management
- **Algorithms**: Efficient time calculations using modulo arithmetic
- **GUI**: Built with Java Swing
- **Precision**: Stopwatch updates every 10ms for accurate timing
## How to Run
1. Ensure you have Java JDK installed (version 8 or higher recommended)
2. Compile the Java file:
```bash
javac StopWatch.java
### Run the application
java StopWatch
## Future Enhancements
- Add 12-hour format option for the clock
- Implement lap time statistics (fastest/slowest/average)
- Add sound notifications
- Save lap times to file