anuragregmi / Calculator

A basic calculator using Java Swing .

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Calculator ( हिसाब यन्त्र )

Anurag’s हिसाब यन्त्र

Introduction

हिसाब यन्त्र is a desktop application which is implemented in Java Platform. It ,a calculator with basic functionalities, is developed using Java Swing graphical user interface (GUI) toolkit. It supports four basic operations addition, subtraction multiplication, and division.

Product Details

Dependencies

हिसाब यन्त्र is a JAVA application so it requires followings to run properly

  1. a JAVA runtime environment installed on your system

Installation

You can clone the project and compile yourself.

If you prefer a jar file then click Download.

User Interface

हिसाब यन्त्र is very user friendly and intuitive and uses a GUI interface implemented in JAVA to communicate with user.
A look at हिसाब यन्त्र

Fig. हिसाब यन्त्र

Features

The features of हिसाब यन्त्र are:

  1. Two way input: You can input from both buttons on the screen as well as from your keyboard.
  2. Operations: You can do addition, subtraction, multiplication, division, power and precentage.
  3. Shortcuts: ESC clears the input field and RETURN evaluates the expression in the field.
  4. Auto-remove invalid characters: It automatically removes invalid characters such as alphabets, other special symbols etc.
  5. Opens Under Mouse Pointer: The window opens where the pointer of your mouse lies on the screen.
  6. Pop-Up Message: If the entered expression is wrong then a message pop-ups saying your expression is wrong.

Future goals

The future goals for this project are:

  • Bracket completion
  • Enable use of trigonometric ratios

Code Description

Class Diagram

Class Diagram

GUI Hierarchy

GUI Hierarchy

For further documentation view Javadoc.

Usage

Create and Display

You can create a calculator by making the object of Calculator

  Calculator calc = new  Calculator();  // initializes calculator

It initializes the calculator and its components.

Now to pack those components call pack()

  calc.pack();  // packs components to the frame

Then to make calculator visible call show()

  calc.show();  // display the calculator
Add Footer Text [Optional]

If you want to add some text in the footer you can use setFooterText(text) Here text is an argument of type text which you want to put in footer.

  calc.setFooterText("This is footer text");  // sets footer text

Use this method before packing

About

A basic calculator using Java Swing .

License:GNU General Public License v3.0


Languages

Language:Java 89.0%Language:HTML 11.0%