/Calculator

Simple Calculator using Java Swing, make user able to make simple operations and save the history of the operations done.

Primary LanguageJava

Calculator

Simple Calculator using Java Swing, make user able to make simple operations and save the history of the operations done.

Instruction

  • User can input his values using buttons and choose between operations to get his answer.

  • If user entered his first number then clicked on more than one operator then he entered his second number, the calculator will use the first one only and calculate the result.

  • User can navigate through a list which record his operations and on clicking on any line in this list, it will automatically display the selected line in calculation’s Text Field to recalculate it after recalculating the full operation line will be recorded as a new line in history. N.B: the user should erase the line of history till the first number then choose the operation again and his second number again for example 1+1=2 (this will be displayed in text field)
    1 (user erase till the first number) 1+1 (user choose an operation and a second number)

  • User is able to clear the history using Clear History button.

  • The +/- button make user able to calculate negative numbers by select his first number the click on this button the value of his number will change to negative.

  • The C button erase the text field area totally to do another operation, also after every operation user should erase his line of operation first then enter new values.

  • Backspace button erase one digit on click .

  • This calculator could handle errors like number/0 or 0/0 and display message to user with this error.

  • The label above text field show user his full operation while typing it.

Screenshot

https://user-images.githubusercontent.com/34577933/57371507-3849c280-7193-11e9-9e69-9034f2cb30b5.png