Saturday, 3 September 2016

Creating a Calculator in JAVA


Step 1: Creating a new project


·         Click on the file menu and then select New Project.

·         Now select the Java node from the Categories on the left and select Java Application from the Projects menu on the right.
Click Next.

n

·         Now name the project as Calculator and leave the Create Main Class check box unselected.




·         Now you will see the project in the projects view on the left. Now Right_Click the project and follow the steps below. 


Now select JFrame Form
·      Now provide the name to the JFrame Form. Ignore the messages displayed at the bottom.
For detailed explanation See Here.

Now click finish.

·         Now you will be shown the design view. Now create the layout below using the pallete on the right.
Drag a jtextfield on the design area.
Now drag and drop a jpanel. Set the layout of the jpanel to be gridlayout.
Now Click on the gridlayout from the navigator view on the left and move to the properties view on the right.
Now drag and drop 16 buttons from the pallete to the jpanel on the design area.

·        

After creating the above format, copy and paste the code given below.
·         Enjoy your first java made calculator.

:: Source code ::



CHEERS!!!



0 comments :

Post a Comment