Skip to content

This Window Calculator have been developed in Java NetBeans with a JFrame component. On the JFrame have been created a JPanel which holds all the buttons and TextField. Also a MenuBar have been developed and includes two separate Menus: File and Help. File option includes and Exit MenuItem which when pressed, will exit the program. The Help Menu…

Notifications You must be signed in to change notification settings

rotaruciprian81/Java-Calculator-using-Java-swing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Java-Calculator-using-Java-swing

This Window Calculator have been developed in Java NetBeans with a JFrame component. On the JFrame have been created a JPanel which holds all the buttons and TextField. Also a MenuBar have been developed and includes two separate Menus: File and Help. File option includes and Exit MenuItem which when pressed, will exit the program. The Help Menu includes an About MenuItem which will display thru a dialog box the name of the developer.

On the Jpanel have been created a number of buttons which will hold different functions and TextField for the user to input data. Every button will have a different function, which can either be a number (the one written on top of the button) or a mathematical operation. Inside the source code it can be seen that at the beginning have been imported the java.lang.library. Also, 4 variables have been declared in order to store the numbers inputted by the user, and to display the result. The lost variable will be of string type and will hold the symbol for the operation which will be executed. In case of buttons which are used to input numbers, it can be seen from the code that first a variable of type string is declared. This variable will hold the characters which are already on the text field (it this case numbers), and will add the next one taken. The number will be converted into double before mathematical operations. The mathematical operational like +, - will hold a unique operation. Using a switch operator the programme will check which operation has been chosen by the user and it will do the mathematical operation assigned to each case. The more complicated mathematical operations will be executed with help of library java.lang.math, which stores all the formulas.

About

This Window Calculator have been developed in Java NetBeans with a JFrame component. On the JFrame have been created a JPanel which holds all the buttons and TextField. Also a MenuBar have been developed and includes two separate Menus: File and Help. File option includes and Exit MenuItem which when pressed, will exit the program. The Help Menu…

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages