[Implementation] Button Calculator

Button Calculator

Button Calculator

So, this is the completed calculator!

Although this might look similar to the default Windows Calculator, this has more functions!

To develop this simple calculator, I used only a Java class, which extends JFrame.

To the frame, I added two features: JTextField and JPanel.

JTextField was adequate to hold the output screen and JPanel was used to hold the buttons (JButton).

Also, for each and every button, ActionListener was added to react to user’s mouse clicks.

With those Java objects, I built up Graphic User Interface of the calculator.

I would like to skip the logic part as it is too straightforward (come on! it is too simple calculator).

In future, I would like to develop a calculator that computes a whole equation with brackets instead of using buttons.


About Wonjohn Choi
Hello, I am a software developer Wonjohn Choi. I live in Mississauga, Ontario, Canada and study at a school called St. Francis Xavier Secondary School. My core interests include Math, Computer Science, and Engineering. Thank you.

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

%d bloggers like this: