Simple Calculater made with java GUI
This Java program creates a simple calculator with a graphical user interface (GUI) using the AWT (Abstract Window Toolkit) library.
- Addition: Enter two numbers and click the "+" button to perform addition.
- Subtraction: Enter two numbers and click the "-" button to perform subtraction.
- Result Display: The result of the calculation is displayed in a text field.
These instructions will help you compile and run the program on your local machine.
- Java Development Kit (JDK) installed on your machine.
-
Save the code in a file named Calci.java.
-
Open a terminal or command prompt and navigate to the directory where the Calci.java file is located.
-
Compile the Java code by executing the following command:
javac Calci.java
-
Run the compiled program with the following command:
java Calci
-
The calculator GUI will open in a new window.
-
Enter two numbers in the provided text fields.
-
Click the "+" button to perform addition or the "-" button to perform subtraction.
-
The result of the calculation will be displayed in the third text field.