A clean, professional Calculator Desktop Application built using pure Java (Swing).
This project is inspired by the OnePlus Nord Calculator UI and focuses on clean design, solid logic, and interview-ready code.
- Modern dark UI inspired by OnePlus Calculator
- Basic arithmetic operations:
- Addition (+)
- Subtraction (−)
- Multiplication (×)
- Division (÷)
- Extra calculator features:
- AC (All Clear)
- Backspace
- Percentage (%)
- Plus/Minus toggle (+/−)
- Double Zero (00)
- Handles edge cases:
- Division by zero
- Clean integer / decimal output
- Keyboard-free, button-driven UI
- Fully event-driven using Java Swing
- Language: Java
- GUI Framework: Java Swing
- IDE: IntelliJ IDEA
- Architecture: Single-class (simplified for learning & interviews)
Inspired by OnePlus Nord Calculator
Dark theme with orange operator buttons for clarity and usability
- Uses event-driven programming with
ActionListener - Maintains calculator state using:
firstNumberoperatorstartNewNumber
- Clean separation of responsibilities using helper methods:
appendNumber()setOperator()calculate()clearAll()toggleSign()
- Prevents multiple decimal points
- Shows
Erroron division by zero - Automatically removes
.0from whole number results - Resets calculator state correctly after each calculation
- Clone the repository
git clone https://github.com/your-username/java-swing-calculator.git
2.Open the project in IntelliJ IDEA
3.Run CalculatorFrame.java
4.Enjoy 🚀
👨💻 Author
Abhishek Karande B.Tech IT | Java Developer | Swing GUI Projects
This project was built to strengthen core Java concepts and demonstrate clean desktop application development.
⭐ If you like this project
Give it a ⭐ on GitHub — it really helps!