Calculator using Java Swing #javacode02

  Calculator Using Java Swing

JavaCode2

Introduction :
Made a calculator project using java swing using Eclipse Ide this calculator can Perform basic operation like addition, subtraction, divison and multiplication. 
Made a gui with the help of Eclipse IDE 2021-12 and JDK 17.

Working : I have made a 2 radio button which enables all the button of gui using a Jradiobutton and group them in buttongroup object so that at a time only one can be selected.

Off radio button calls the disable method, In this method I have write a code that disable all button but by default I have made the button disable so that user need to turn on the calculator.

On Radio Button call the enable method which enable all the button in the calculator.
Each button in calculator performs a Action event listener interface.

Every Button sets the text into the maindisplay which is JTextField in calculator. I have added some trigonometric and hyperbolic functions in the calculator. Also the Square root, Square and cube of the number. 

Manual : 
1. First Turn on the calculator by pressing the On RadioButtton. This will turn on all the the buttons in calculator.
2. Click on the number or manually enter number from Keyboard.
3. Click on anyone operation button like "+" , "-" and many more to do operation.
4. After clicking on operation button the text will be setted on the Maindisplay up Field as JLabel.
5. Now enter the Second Number.
    eg.           5+
                    7 
6. Now click on Equal button this will add the number.
7. To do Operation on Trigonometric, Hyperbolic and Square follow the steps :
    a. Enter the number which you want to do any following Operation.
    b. Click on Appropriate button and see the ans is in Maindisplay and your entered data is up of the            maindisplay.
    c. Same steps follow for cube and square root.
8. After that you can clear all text by pressing AC button.
9. To Turn Off the calculator click on the Off RadioButton.


Conclusion : This is the first project of my swing.

Below i have Attached code and some Screenshots of my Code.


Off Calculator

Performing Sin Operation on Calculator

Performing 1/x on Calculator

Performing Cube of 3

Performing Multiplication

Performing Square Root

Performing Addition

Turn ON Calculator

Reference : 

2. https://www.youtube.com/watch?v=_ZW4ktG1DEE - Taken Reference for operation button.


Code :

   Download Jar File  ->  Click Here 

   Download Code File ->  Click Here

***********************************************************************************

                        

 


Comments