Skip to content

Latest commit

 

History

History
55 lines (41 loc) · 1.59 KB

File metadata and controls

55 lines (41 loc) · 1.59 KB

🧮 Java Swing Calculator

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.


✨ Features

  • 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

🚀 How to Run

  1. Clone this repository:
    git clone https://github.com/thecopyninja55/Java-calculator.git
  2. Navigate into the project directory:
    cd Java-calculator
  3. Compile the program:
    javac Calculator.java
  4. Run the program:
    java Calculator
    

🛠️ Tech Stack

  • Language: Java
  • GUI Framework: Swing (AWT components)
  • Concepts Used: Event-driven programming, Stacks, Expression Parsing

📈 Future Improvements

  • Add support for brackets ( ) in expressions
  • Include advanced functions like square root, power, percentage
  • Improve UI design with modern styling
  • Add keyboard input support

👨‍💻 Author

🧑‍🚀 Developed by sebs

👉 If you like this project, consider giving it a ⭐ on GitHub!