This is a simple calculator application built using Java AWT and Swing components. The calculator supports basic arithmetic operations including addition, subtraction, multiplication, division, and exponentiation.
- Basic arithmetic operations: addition, subtraction, multiplication, division
- Exponentiation
- Clear functionality
- Keyboard support for Enter (evaluate) and Delete (clear)
- Java Development Kit (JDK) 8 or higher
- Apache NetBeans IDE (or any other Java IDE)
-
Clone the repository or download the source code.
-
Open Apache NetBeans.
-
Create a new Java project:
- Go to
File>New Project. - Select
Java>Java Application. - Click
Next.
- Go to
-
Import the source code:
- Copy the
Main.javafile into thesrcfolder of your new project.
- Copy the
-
Build and run the project:
- Right-click on the project in the
Projectspane. - Select
Run.
- Right-click on the project in the
-
Clone the repository or download the source code.
-
Navigate to the project directory:
cd /path/to/project -
Compile the Java file:
javac Main.java
-
Run the compiled Java class:
java Main
- Use the buttons on the calculator to input numbers and operations.
- Press
=to evaluate the expression. - Press
Cto clear the input. - You can also use the keyboard:
- Press
Enterto evaluate the expression. - Press
Deleteto clear the input.
- Press
This project is licensed under the MIT License.