A Simple semi-Scientific Calculator in Java

I made this Calculator Application for a lab experiment in my college. I thought I’d put it out here. But I will not be providing any explanation for the code. The explanation will be covered in a series of tutorials that I will be writing very soon and it deals with the Event Handling techniques and Basic Java Swing programming. So if you have any doubt about the code just drop a comment or email me and Ill be more than glad to help you! And btw, this is for educational purposes only. So dont copy and use it for your School or College home works. And it has a lot of flaws in its design. I just made a quick and simple app. Ill be making a comprehensive one later that will have a lexer and parser in it which enables evaluation of complex expressions. And I forgot to add the keyboard input support. So all that will be coming with Version 2.0! I hope this is useful for you!

Application GUI:

Runnable Jar (V 1.1):

MediaFire Link – Calculator.jar

Source Code (V 1.1):



Applet (V1.1)


Im releasing the source code for this. Please report any bugs. And if anyone has advanced this in anyway feel free to post here!

I hope most of you know how to run an applet. Just compile the code using javac and then run the command

appletviewer Calculator.java

Happy Learning,

Steve Robinson


Note: Minor Errors were rectified.

Change Log:


1. Fixed Issues with x^2 and x^3

2. Fixed Issues with “ANS” key

3. Fixed some issues with entering input after an operation


One thought on “A Simple semi-Scientific Calculator in Java

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s