Skip to content

asfiyaanjum/online-voting-system-java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

Java Online Voting System

This is a complete online voting system built only with Java. It does not use HTML, CSS, JavaScript, PHP, database servers, or any other tech stack. The interface is made with Java Swing.

Features

  • Admin and voter login
  • Voter registration
  • Admin voter deletion before voting
  • Election title, notice, and open/close voting control
  • Voting start time and end time control
  • Candidate add/remove management
  • One vote per voter
  • Live result table for admin and voters
  • Winner/current leader display with tie handling
  • Registered voter status table
  • File-based data persistence using Java serialization
  • Result export to a text file
  • Seed accounts and candidates for quick testing

Default Login

Admin:

User ID: admin
Password: admin123
Role: Admin

On the login screen, make sure you select Admin in the Role dropdown.

Sample voters:

User ID: voter1
Password: vote123
Role: Voter

User ID: voter2
Password: vote123
Role: Voter

Run

Compile:

javac -d out src/votingsystem/OnlineVotingSystem.java

Run:

java -cp out votingsystem.OnlineVotingSystem

The application creates voting-data.ser in the project folder after saving data.

Timeline And Winner

Admin can open the Election tab and set:

Voting Start Time: yyyy-MM-dd HH:mm
Voting End Time: yyyy-MM-dd HH:mm

Example:

2026-05-08 19:30

Voters can vote only between the start and end time while voting is open. The Results tab shows the winner after the end time, or the current leader while voting is still active.

                                                                           © 2026 Asfiya Anjum

About

A complete Online Voting System developed using Java and Java Swing, featuring admin/voter login, voter registration, candidate management, voting timeline, one-time voting, voter management, winner display, and local file-based storage.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages