A Java Swing desktop clock application with dark/light theme, analog dial, timezone picker, stopwatch, countdown timer, and alarm. Pure Java SE — no external dependencies.
- Digital clock — 12H/24H format toggle, colon‑blink effect, AM/PM indicator
- Analog dial — Java2D‑rendered face with hour, minute, second hands
- Dark / Light theme — ☀/☾ toggle, colors synced across all panels
- Timezone picker — 🌐 globe button opens a searchable dialog of ~600 IANA zones grouped by country; heading and GMT offset update live
- Stopwatch — ⏱ Start/Stop, Lap recording with auto‑scrolling list, Reset
- Countdown timer — ⏲ +1/+5/+10/+30 min presets, Start/Pause/Resume, audible beep on zero
- Alarm — ⌚ set time with ▲/▼ adjusters, AM/PM toggle, arm with Dismiss & Snooze (+5 min); repeats beep until dismissed
- Persistence — theme, format, timezone, alarm state, and window position saved across restarts via
java.util.prefs
| Dark Theme (12H) |
Light Theme (24H) |
 |
 |
| Feature |
Dark |
Light |
| Timezone Picker |
 |
 |
| Stopwatch |
 |
 |
| Timer |
 |
 |
| Alarm |
 |
 |
# Compile
javac -d out src/com/digiclock/*.java
# Copy resources (fonts + icon)
cp -r src/com/digiclock/resources out/com/digiclock/
# Run
java -cp out com.digiclock.Main
| Button |
Action |
| 🌐 |
Open timezone picker |
| ⏱ / ⏰ |
Toggle stopwatch |
| ⏲ / ⏰ |
Toggle timer |
| ⌚ / ⏰ |
Toggle alarm |
| 24H / 12H |
Toggle time format |
| ☀ / ☾ |
Toggle dark/light theme |
- Java 8+ (
java.time, javax.sound.sampled)
- No external dependencies — pure Java SE
The app loads three custom .ttf fonts at runtime (bundled under resources/fonts/):
src/com/digiclock/
├── Main.java — Application entry point
├── Window.java — Main JFrame, layout, theme, preferences
├── ClockPanel.java — Digital clock with java.time background thread
├── DialPanel.java — Analog clock dial (Java2D)
├── TimezonePicker.java — Searchable timezone selection dialog
├── Button.java — RoundedButton + RoundedBorder
├── AudioUtil.java — Shared playBeep() via javax.sound.sampled
├── StopwatchPanel.java — Stopwatch (Start/Stop, Lap, Reset)
├── TimerPanel.java — Countdown timer (+1/+5/+10/+30, Start/Pause)
├── AlarmPanel.java — Alarm (set time, arm, ring, Dismiss/Snooze)
└── resources/
├── icons/clock_icon.png
└── fonts/*.ttf