Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

Java program Calculator,help Please!?

i'm trying to build a calculator with the basic operations ( +, -, * ,/) and the root square as well as the decimal point

but when clicking on the form on the root square or the decimal point they're still not working as if it's concatenating the numbers although i did parse them

and i'm trying to do any operation for more than just 2 inputs and something is still wrong it also seems that the numbers or actually certain numbers are being concatenated instead of applying the operation on

so can you please help me?

thanks !

here 's the code

https://drive.google.com/file/d/0B6NPKZsgNLOCZEFNa...

Update:

you should download it it's . java and it represents the JFrame in which the whole process goes in

1 Answer

Relevance
  • 8 years ago
    Favorite Answer

    Your SqrtActionPerformed() method has a bad String append value. And, I'm not quite sure what your Equals action listener is trying to do. By the time you click equals, you should have a value assigned to input1 and input2, so there should be no double parsing. Double parsing should only be happening when a number is clicked.

Still have questions? Get your answers by asking now.