A beginner-friendly, fully-featured banking system built with Java.
Covers OOP, Collections, Swing GUI, Exception Handling, File I/O, Inheritance & Polymorphism.
BankingSystem/
└── src/
└── banking/
├── model/
│ ├── Customer.java # Customer entity (name, email, hashed PIN)
│ ├── Account.java # Abstract base class for all account types
│ ├── SavingsAccount.java # Savings: min balance ₹500, 4% interest
│ ├── CurrentAccount.java # Current: no min balance, optional overdraft
│ └── Transaction.java # Transaction record (type, amount, timestamp)
├── manager/
│ └── BankManager.java # Core business logic: create, deposit, withdraw, transfer
├── exception/
│ └── BankingException.java # Custom runtime exception
├── util/
│ └── FileManager.java # File I/O: save/load accounts, customers, export logs
└── gui/
└── BankDashboard.java # Swing GUI — light-mode dashboard with 8 panels
| Feature | Details |
|---|---|
| Account Creation | Savings (min ₹500 deposit) or Current account |
| Customer Management | Full profile: name, email, phone, address, hashed PIN |
| Deposit | Add funds with live balance update |
| Withdrawal | Enforces minimum balance rules |
| Fund Transfer | Between any two active accounts |
| Transaction Log | Timestamped history per account (table view) |
| Log Export | Save transaction history as .txt to bank_data/ |
| Data Persistence | Accounts and customers auto-saved via Java Object Serialization |
| Dashboard Stats | Live count of accounts, customers, total balance |
Customer— Encapsulates customer data with PIN hashingAccount— Abstract class with template for all account typesTransaction— Immutable record with enum-based type systemBankManager— Orchestrates all banking operations
HashMap<String, Account>— Fast account lookup by account numberHashMap<String, Customer>— Customer registry keyed by customer IDArrayList<Transaction>— Per-account transaction history list
JFrame+CardLayout— Multi-panel navigationJTable+DefaultTableModel— Tabular transaction/account display- Custom light-mode palette, hover effects, styled buttons
BankingException(custom) — Overdraft prevention, invalid inputNumberFormatException— Invalid amount entries caught gracefully- All exceptions displayed in the UI as user-friendly error messages
ObjectOutputStream/ObjectInputStream— Binary serialization of MapsPrintWriter/FileWriter— Plain-text transaction log export- Auto-creates
bank_data/directory on first run
SavingsAccount extends Account— OverridescanWithdraw()to enforce ₹500 minimumCurrentAccount extends Account— OverridescanWithdraw()to support overdraftBankManagerworks withAccountreferences (polymorphism)
- Java JDK 11 or higher installed
- Any IDE (IntelliJ IDEA, Eclipse, VS Code with Java extensions) or command line
# 1. Navigate to the project folder
cd BankingSystem
# 2. Compile all source files
mkdir -p out
javac -d out $(find src -name "*.java")
# 3. Run the application
java -cp out banking.gui.BankDashboard- Open IntelliJ → File → Open → select
BankingSystem/ - Mark
srcas Sources Root (right-click → Mark Directory as → Sources Root) - Open
BankDashboard.javaand click the ▶ Run button
- File → New → Java Project → uncheck "Use default location" → browse to
BankingSystem/ - Eclipse auto-detects the source structure
- Run
BankDashboard.javaas Java Application
- New Customer → Enter name + PIN → Get Customer ID (e.g.
CUST00001) - Open Account → Paste Customer ID → Choose Savings/Current → Enter initial deposit → Get Account Number (e.g.
SAV000001) - Deposit → Enter Account Number + Amount → Confirm
- Withdrawal → Enter Account Number + Amount (Savings enforces ₹500 minimum)
- Transfer → Enter From/To account numbers + Amount
- Transactions → Enter Account Number → View full timestamped log → Export as
.txt - All Accounts → See a live overview of every account in the system
All data is automatically saved to bank_data/ after every operation:
accounts.dat— Serialized account objectscustomers.dat— Serialized customer objectstxn_ACCNO.txt— Exported transaction logs (generated on demand)
| Account Type | Minimum Balance | Withdrawal Rule | Extra |
|---|---|---|---|
| Savings | ₹500 | Balance after withdrawal ≥ ₹500 | Supports interest application |
| Current | ₹0 | Balance ≥ -overdraftLimit | Supports overdraft (default ₹0) |
- PINs are stored as a simple hash (not bcrypt — this is intentional for beginner scope)
- All inputs are validated before any operation
- Custom
BankingExceptionprevents illegal state (overdraft, inactive accounts) - Accounts are marked Active/Inactive (extendable to support account locking)
- Add login screen with PIN authentication
- Implement interest calculation scheduler
- Add account closing functionality
- Use a proper database (SQLite / H2) instead of object serialization
- Add search/filter to transaction and account tables