/Java_21_JFrame_Sum_2

Simple Demonstration of a program working as a calculator, we just need to have two inputs of numbers (Double) and then click on calculate th esum button to find out the sum for the two numbers.

Primary LanguageJava

Java_21_JFrame_Sum_2

Overview of the Program:

1 - as always starting with the importing of 3 libraries of events and swing, etc.

2 - defining our Jcomponents at the start.

3 - defining a gridLayout and then positioning different JComponents based on the Layout's size and dimentions.

4 - using an implementation of ActionListener is a good idea to remove the process of making a named or no-named class for ActionListening and also making ActionHandler values,etc.

5 - lastly, the result when button is clicked will be programmed on the actionPerformed part (getting the text from two grid cells and setting the text as sum in another cell when the button is clicked).