This is a Java-based Calculator application built using Swing for the graphical user interface (GUI).
The calculator supports basic arithmetic operations such as addition (+), subtraction (-), multiplication (*), and division (/) along with handling decimal numbers and operator precedence.
The application uses a custom expression evaluation method powered by stacks, ensuring that multi-operator expressions (e.g., 5+2-4*3/2) are computed correctly according to mathematical precedence rules.
- Clean and interactive Java Swing GUI
- Supports multi-operator expressions
- Handles decimal numbers
- Clear (
C) button to reset input - Operator precedence implemented with stacks
- Beginner-friendly and extendable project
- Clone this repository:
git clone https://github.com/thecopyninja55/Java-calculator.git
- Navigate into the project directory:
cd Java-calculator - Compile the program:
javac Calculator.java
- Run the program:
java Calculator
- Language: Java
- GUI Framework: Swing (AWT components)
- Concepts Used: Event-driven programming, Stacks, Expression Parsing
- Add support for brackets ( ) in expressions
- Include advanced functions like square root, power, percentage
- Improve UI design with modern styling
- Add keyboard input support
๐งโ๐ Developed by sebs
๐ If you like this project, consider giving it a โญ on GitHub!