Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,151,583 members, 7,812,910 topics. Date: Monday, 29 April 2024 at 10:06 PM

How To Create A Simple Calculator Using Java Programing Language GUI - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / How To Create A Simple Calculator Using Java Programing Language GUI (8699 Views)

Trick: How To Make A Simple Calculator Using Notepad. / How To Make A Simple Calculator In Notepad Using .bat Format / Which Programing Language Is Best To Start With (2) (3) (4)

(1) (Reply) (Go Down)

How To Create A Simple Calculator Using Java Programing Language GUI by mmsh350(m): 11:22am On Sep 09, 2012
import javax.swing.JOptionPane;

public class Calculator{

public static void main(String args[]){
int sum=0;
String ans=" ";
int number=0;

ans=JoptionPane.showInputDialog(null,"Enter a number pls:"wink;
number=Integer.parseInt(ans);
For (int i=1; i < number;i++ )

sum+=i;

JoptionPane.showMessageDialog(null,"The total sum of the numbers is ="+sum);
}
}

1 Like

Re: How To Create A Simple Calculator Using Java Programing Language GUI by mmsh350(m): 2:29pm On Sep 09, 2012
mmsh350: import javax.swing.JOptionPane;

public class Calculator{

public static void main(String args[]){
int sum=0;
String ans=" ";
int number=0;

ans=JOptionPane.showInputDialog(null,"Enter a number pls:"wink;
number=Integer.parseInt(ans);
for(int i=1; i < number;i++ )

sum+=i;

JOptionPane.showMessageDialog(null,"The total sum of the numbers is ="+sum);
}
}

1 Like

Re: How To Create A Simple Calculator Using Java Programing Language GUI by pseudonomer: 10:43am On Sep 10, 2012
Where can I get deep learning of Java GUI and also how can I convert my simple java program to a web based java version.
Re: How To Create A Simple Calculator Using Java Programing Language GUI by mmsh350(m): 1:28pm On Sep 11, 2012
I can teach you the best i know,
Re: How To Create A Simple Calculator Using Java Programing Language GUI by mkwayisi: 4:06pm On Sep 14, 2012
That's exactly the kinda program I'm going to write this weekend. But mine is a bit more advanced (standard and scientific modes with hex, dec, oct and bin conversions. Cool!). I'd send you the source if you want it.

2 Likes

Re: How To Create A Simple Calculator Using Java Programing Language GUI by mmsh350(m): 3:54pm On Sep 26, 2012
ok am waiting!!!
Re: How To Create A Simple Calculator Using Java Programing Language GUI by mkwayisi: 4:14pm On Sep 26, 2012
PM me your email address so I can send it over to you.
Re: How To Create A Simple Calculator Using Java Programing Language GUI by mmsh350(m): 5:52pm On Oct 03, 2012
dis is my email:sani.muhammad37@yahoo.com
Re: How To Create A Simple Calculator Using Java Programing Language GUI by mkwayisi: 10:59pm On Oct 03, 2012
OK, so I've uploaded it online: EasyCalc: A GUI Java scientific calculator
Re: How To Create A Simple Calculator Using Java Programing Language GUI by mashnino(m): 7:56am On Oct 04, 2012
This is not JAVA G.U.I...

You are just goofing around JOptionPane and all...

but you tried sha...

this is a simple calculator...and from what i can see it only works with one parameter..
Re: How To Create A Simple Calculator Using Java Programing Language GUI by mkwayisi: 8:03am On Oct 04, 2012
mashnino: This is not JAVA G.U.I...

You are just goofing around JOptionPane and all...

but you tried sha...

this is a simple calculator...and from what i can see it only works with one parameter..

Are you referring to mine. I guess not ;-)
Re: How To Create A Simple Calculator Using Java Programing Language GUI by mashnino(m): 8:04am On Oct 04, 2012
mkwayisi:
Are you referring to mine. I guess not ;-)

nope my niccur..i was refferin to the code that is visible(true);
Re: How To Create A Simple Calculator Using Java Programing Language GUI by Manus17(m): 8:59am On Oct 06, 2012
Kindly send it to my email too 'usmankasim22kasim22@gmail.com
Re: How To Create A Simple Calculator Using Java Programing Language GUI by mkwayisi: 9:29am On Oct 06, 2012
Manus17: Kindly send it to my email too 'usmankasim22kasim22@gmail.com
I posted a link to download above.
Re: How To Create A Simple Calculator Using Java Programing Language GUI by mmsh350(m): 6:07pm On Oct 17, 2012
thank you my dear mashnino but i want u to know that i know what am doing,and i also want u to know that the word GUI stand for Graphical user interface so as you can see JOptionpane is a way of display message Graphically.
And the reason why am in this forum is because i want to learn more on what are know and to also help my friends with what they don't know.
Re: How To Create A Simple Calculator Using Java Programing Language GUI by mmsh350(m): 6:18pm On Nov 06, 2012
Thanks mkwayisi
Re: How To Create A Simple Calculator Using Java Programing Language GUI by danmc: 12:57am On Aug 25, 2013

(1) (Reply)

Access Bank Mobile App Redesign (work In Progress) / Is There Any Chance That A Female Can Become A Very Good Programmer / Nigerian Stock Exchange (nse)api

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 15
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.