Skip to content

Mudit-Chaudhary/Digital_Clock

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Digital Clock

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.

Features

  • 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

Screenshots

Dark Theme (12H) Light Theme (24H)
Dark Light
Feature Dark Light
Timezone Picker TZ dark TZ light
Stopwatch STW dark STW light
Timer Timer dark Timer light
Alarm Alarm dark Alarm light

Build & Run

# 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

Controls

Button Action
🌐 Open timezone picker
⏱ / ⏰ Toggle stopwatch
⏲ / ⏰ Toggle timer
⌚ / ⏰ Toggle alarm
24H / 12H Toggle time format
☀ / ☾ Toggle dark/light theme

Requirements

  • Java 8+ (java.time, javax.sound.sampled)
  • No external dependencies — pure Java SE

Fonts

The app loads three custom .ttf fonts at runtime (bundled under resources/fonts/):

  • Audiowide — heading / title
  • Orbitron — time displays and stopwatch/timer/alarm readouts
  • Rajdhani — date and GMT offset label

Project Structure

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

About

Pure Java SE desktop clock: dark/light themes, analog dial, country-grouped timezone picker, stopwatch, timer, alarm with snooze — zero dependencies.

Resources

License

Stars

2 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors

Languages