A complete ATM Management System built with Java OOP, Swing GUI, and MySQL database. This is a production-ready desktop application suitable for ATM operations.
β User Authentication
- User signup with validation
- Secure PIN-based login
- Email uniqueness validation
β Banking Operations
- Deposit money
- Withdraw money (with balance validation)
- Check account balance
- Transaction history (last 10 transactions)
β Database Management
- Persistent data storage in MySQL
- Transaction logging
- User account management
β UI/UX
- Clean, professional Swing interface
- Designed for laptop screens (900x600)
- Color-coded operations
- Easy navigation between screens
- Language: Java (OOP)
- GUI Framework: Swing
- Database: MySQL
- JDBC Driver: MySQL Connector/J (v8.0+)
ATM-System/
βββ src/
β βββ main/
β β βββ Main.java
β βββ ui/
β β βββ LoginFrame.java
β β βββ SignupFrame.java
β β βββ DashboardFrame.java
β β βββ DepositFrame.java
β β βββ WithdrawFrame.java
β βββ model/
β β βββ User.java
β β βββ Account.java
β βββ dao/
β β βββ DBConnection.java
β β βββ UserDAO.java
β β βββ AccountDAO.java
β β βββ TransactionDAO.java
β βββ services/
β βββ AuthService.java
β βββ TransactionService.java
β βββ Validator.java
βββ sql/
β βββ schema.sql
βββ README.md
- Download and install MySQL from mysql.com
- Start the MySQL server
- Ensure MySQL is running on
localhost:3306
- Open MySQL Workbench or MySQL Command Line
- Run the SQL script to create the database:
mysql -u root -p < schema.sqlOr paste the contents of schema.sql file in MySQL Workbench.
Output:
Database "atm_system" created successfully
Tables created: users, accounts, transactions
-
Download MySQL Connector/J from: https://dev.mysql.com/downloads/connector/j/
-
Or install via Maven:
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.33</version>
</dependency>Edit dao/DBConnection.java and set your MySQL credentials:
private static final String URL = "jdbc:mysql://localhost:3306/atm_system";
private static final String USER = "root"; // Your MySQL username
private static final String PASSWORD = "root"; // Your MySQL passwordUsing Command Line:
- Copy all Java files to a folder
- Ensure MySQL JDBC driver is in classpath:
javac -cp mysql-connector-java-8.0.33.jar src/**/*.java -d bin/Using IDE (IntelliJ/Eclipse):
- Create a new Java project
- Add project structure (src/main, src/ui, etc.)
- Add MySQL JDBC JAR to project libraries
- Build the project
java -cp bin:mysql-connector-java-8.0.33.jar main.MainOr run directly from IDE by running Main.java
After running schema.sql, you can use this test account:
Email: test@example.com
PIN: 1234
Balance: 1000
To add this test account, uncomment the sample data in schema.sql:
INSERT INTO users (name, email, pin) VALUES ('Test User', 'test@example.com', '1234');
INSERT INTO accounts (user_id, balance) VALUES (1, 1000.00);- Enter your email and PIN
- Click "Login" to access your account
- New users click "Sign Up"
- Enter full name (minimum 3 characters)
- Enter email (valid format)
- Enter PIN (4-10 digits)
- Confirm PIN
- Click "Sign Up"
After login, you can:
- Deposit Money - Add funds to your account
- Withdraw Money - Withdraw funds (if balance sufficient)
- Check Balance - View current balance
- Transaction History - See last 10 transactions
- Logout - Exit the application
Solution:
- Ensure MySQL server is running
- Check if port 3306 is accessible
- Verify credentials in
DBConnection.java - Run
mysql -u root -pto test connection
Solution:
- Add mysql-connector-java-8.0.33.jar to your classpath
- In IDE, add JAR to project libraries
- Ensure JAR is in the same folder when running from command line
Solution:
- Run schema.sql again
- Verify database "atm_system" was created
- Check MySQL user has proper permissions
Solution:
- Update password in DBConnection.java
- Or reset MySQL root password
- Check MySQL is using default port 3306
id INT (Primary Key, Auto-increment)
name VARCHAR(100)
email VARCHAR(100) (Unique)
pin VARCHAR(10)
created_at TIMESTAMP
id INT (Primary Key, Auto-increment)
user_id INT (Foreign Key)
balance DOUBLE
created_at TIMESTAMP
id INT (Primary Key, Auto-increment)
user_id INT (Foreign Key)
type VARCHAR(20) - DEPOSIT or WITHDRAW
amount DOUBLE
date TIMESTAMP
β PIN validation (4-10 numeric digits) β Email format validation β Secure user input handling β PreparedStatement (prevents SQL injection) β Balance verification before withdrawal β Prevents negative deposits/withdrawals β Transaction logging for audit trail
Color Scheme:
- Login Frame: Blue (#2980B9)
- Signup Frame: Purple (#9B59B6)
- Dashboard: Light Blue (#3498DB)
- Deposit: Green (#2ECC71)
- Withdraw: Red (#E74C3C)
Screen Size: 900 x 600 (Laptop friendly) Font: Arial (14-36pt depending on use)
- Click "Sign Up" on Login screen
- Enter: Name="John Doe", Email="john@test.com", PIN="5678"
- Confirm PIN="5678"
- Click "Sign Up"
- β Account created successfully
- Login with valid credentials
- Click "Deposit Money"
- Enter amount="1000"
- Click "Deposit"
- β Balance increases by 1000
- Dashboard shows balance
- Click "Withdraw Money"
- Enter amount="500"
- Click "Withdraw"
- β Balance decreases by 500
- Click "Check Balance"
- β Shows updated balance
- Click "Transaction History"
- β Shows DEPOSIT and WITHDRAW records
This project is suitable for:
- Learning Java Swing GUI development
- Understanding OOP principles
- Practicing database design with JDBC
- Portfolio project showcase
Feel free to extend with:
- Transfer between accounts
- Mini statement printing
- PIN change functionality
- Account freeze/deactivate
- Mobile app version
This project is open-source and free to use for educational and personal purposes.
Created as a complete ATM Management System for learning Java, Swing, and MySQL integration.
For issues or questions:
- Check the Troubleshooting section
- Verify database setup
- Ensure MySQL JDBC driver is properly installed
- Check Java version (requires Java 8+)
This project teaches:
- OOP Concepts: Inheritance, Encapsulation, Polymorphism
- Design Patterns: DAO, Service Layer, MVC
- Database Operations: CRUD operations, Foreign Keys, Indexes
- GUI Development: Swing, Event Handling, Layout Management
- Best Practices: Input Validation, Error Handling, Code Organization
Enjoy building! π