A small bank that locks an account after three wrong passwords
NCTN Bank is a desktop program made of dialog boxes. You open an account, move money between accounts, and an admin can unlock anyone who got locked out. I built it in a two-person team for my intermediate programming course. It runs on a computer, not in a browser, so the code is on GitHub.
- Role
- Co-developer in a two-person team
- Timeline
- Started January 2026
- Stack
- Java · Swing (JOptionPane)
Four menu choices
- Create account
- Access account
- Admin
- Exit
Bank
An ArrayList of BankAccount, numbers from 1001
- Deposit
- Withdraw
- Transfer
- History
- Lock after 3 tries
The problem
Many beginner banking programs let anyone in. There is no login and nothing protects the balance, so they teach the arithmetic and skip the part that makes it a bank. Our intermediate programming course asked for a project that pulled several Java ideas together, so we chose a bank with passwords at its centre.
We also wanted it to feel like a program, not an exercise. Instead of typing into a
console, you answer dialog boxes (Java's JOptionPane).
What we built
-
Two classes with clear jobs.
BankAccountholds one account's balance, password and history behind private fields.Bankkeeps every account in anArrayList, hands out account numbers from 1001 and moves money between accounts. - A lock after three wrong passwords. The account locks itself, and only the admin menu can unlock it or reset the password.
- Everyday banking. Open an account with a first deposit, check the balance, deposit, withdraw (never below zero), transfer to another account and read the transaction list.
- An admin menu. Unlock or reset an account, or view all accounts, behind its own password.
- Input checks. Amounts and account numbers are checked before they are used, and every action ends with a message saying what happened.
How it turned out
It is a class project with no real users, so there are no figures to report. It runs from the dialog menus end to end, and the code is public.
Our idea paper promised five features: account creation, login, deposit, withdrawal and balance. The finished program has four more: the transaction history, transfers, the three-strikes lock and the admin menu.
What I would do differently
Everything lives in memory, so closing the program wipes every account; it needs a file
or a database. Passwords are stored and compared as plain text and should be hashed. The
admin password was written straight into the source, so in the public copy I replaced it
with an obvious demo value. The amount check only accepts digits, which means 50.50 is
rejected. And the paper promised try/catch validation where the
code uses a hand-written digit check. A proper window with buttons and a table would
also read better than a chain of dialog boxes.
Want to talk about what I can build now?
Book a 30-minute call. Tell me what the site needs, and I'll tell you honestly whether I'm the right person for it.
Free, 30 minutes on Cal.com. Replies to email within one working day.