How to Create Calculator in Java NetBeans Full Tutorial
HTML-код
- Опубликовано: 5 фев 2025
- How to Create Calculator in Java NetBeans Full Tutorial, using If Statement'
Join this channel to get access to codes, perks, and see more interesting videos. / @djoamen
To support more videos from this channel, visit the Paypal link below.
www.paypal.me/...
Channel Members can Download the Java Calculator and modify it for their own personal use: Plus one other source code per month. Total - 2 Source codes Per Month, only:
drive.google.c...
To Become a Channel member click on the link below to JOIN:
/ @djoamen
To see Java NetBeans Calculator Tutorial using the Switch Statement see link below. • Java NetBeans Tutorial...
How to Create Calculator in Python - Full Tutorial: • How to Create Calculat...
Create C++ Windows Forms application in Visual Studio 2017, See the details of the Forum below:
social.msdn.mi...
How to create Stock Management Systems in Python - Full Tutorial
studio.youtube...
How to Create Advanced Tic Tac Toe Game in Python
www.youtube.co...
How to Create an Advanced Excel Data Entry Form With Search Function using Userform
www.youtube.co...
How to Create Currency Converter with Foreign Exchange Rates in Python
• Data Science Tutorial ...
How to Create Currency Converter with Foreign Exchange Rates in Python
• Data Science Tutorial ...
How to Create a Piano Using Windows Forms Application in Visual C++ 2017
• How to Create a Piano ...
How to Create a C++ Calculator Using Windows Forms Application in Visual Studio 2017
• How to Create a C++ Ca...
Join this channel to get access to perks:
/ @djoamen
Wow! All of the people asking for this code! It's so simple! Great job and explanation.
That's correct, thank you 👍👍
this is good explanation than my lecturer. tq ya
All the best
Thank you from Brazil!
You are welcome!
you forgot to add a conditional statement inside the divide code to check if you divide by 0. You should have text that says "Can't divide by 0"
Well spotted Adam
nice you just help me pass one of exams on university :D
+EZIO Congratulations
+DJ Oamen thank you
thanks Sir for this valuable information, may God give you good health in order to keep helping more people and thanks once again
👍👍
Nicely explained.
Thank you 🙂
Great tutorial. Very well explained. I have a couple of problems - the division sign (/) gives inaccurate results. For example; 6/2 = 3, just fine; but 6/4 = 2, and the decimal doesn't work; 5.5 * 2 = 8. Otherwise very good and helpful. Thanks.
+brodmontgomery Change the equals as follows: switch (operations)
{
case "+":
//secondnum = Double.parseDouble(jtxtDisplay.getText());
result = firstnum + secondnum;
answer = String.format("%.2f", result);
jtxtDisplay.setText(answer);
break;
case "-":
//secondnum = Double.parseDouble(jtxtDisplay.getText());
result = firstnum - secondnum;
answer = String.format("%.2f", result);
jtxtDisplay.setText(answer);
break;
case "*":
//secondnum = Double.parseDouble(jtxtDisplay.getText());
result = firstnum * secondnum;
answer = String.format("%.2f", result);
jtxtDisplay.setText(answer);
break;
case "/":
//secondnum = Double.parseDouble(jtxtDisplay.getText());
result = firstnum / secondnum;
answer = String.format("%.2f", result);
jtxtDisplay.setText(answer);
break;
case "%":
//secondnum = Double.parseDouble(jtxtDisplay.getText());
result = firstnum % secondnum;
answer = String.format("%.2f", result);
jtxtDisplay.setText(answer);
break;
}
+DJ Oamen
Thanks buddy, I get it now - I used ("%4.3f", result); to give me 4 digits total, with 3 after the decimal, and it works fine now.
+brodmontgomery Well done.
Thanks so much for this 👏👏👏
You're so welcome!
You are my savior! I'm pass deadline but thank you!!!!!!!!!!! XD
You're welcome
Thanks for the Tutorial.
Thank you
Thnx alot really it's wonderful ❤
Most welcome 😊
Thank you thank you soo much🥰🥰🥰
You’re welcome 😊
Thanku so much 😭😭😭😭😭😭😭🙏🙏🙏🙏
Thanks
Wow😀 That's lit🔥😎
👍
Thanks for the clear video explanation. Can you please add how to do with decimals
Yes, sure, the video you had a look at is an old one. Check out the link below, the tutorial include decimal and backspace.
ruclips.net/video/Ym9_qF4iGHg/видео.html
Thanks. Very detailed.
Glad it was helpful!
Good job .. Helped me alot..
Thks
thank You for Guidance
You're most welcome
thank you... this is my first succesfull project
You are most welcome
Thanks you just earned a sub
Thanks for the sub!
sir i understand this clearly
Thks
I LIKE THIS VIDEO THIS VIDEO TO MY HELPED AM VERY HAPPY
+Muhammadshafir Kp Thank yu
+DJ Oamen Mr Oamen, how can you write code that makes it impossible for you to insert multiple periods like so "...", which results in an error. Would you use a try/catch construct or another if statement in the '=' operator.
I will public a new video to solve that problem sometime.
Thanks so much! It would be awesome if you could also make the decimals only appear if there's actual decimal numbers. Do you know what I mean?
Thank you very much!
+Manos Grimmjow You're welcome
Thanx sir, a lot of thanx.
Thks
i like ur vids
👍
This was osm
Thanks
At 16:24, when i run the project, it shows : "Calculations.Calculator " does not have a main method." Bt it doesn't give option to set the main method. What should i do? And plz could you send me the code for the "C" button??
+Aashish Shrestha forward your email and the video name you want the code
+DJ Oamen aashishbabu14 @gmail.com i want the code of this very tutorial :)
good job very helpful
Glad to hear that!
Thx , good job
Thank you too!
Thanks you so much. That's so important to me to improve my coding skills
Glad to hear that!
Thanks bro it works for my college task !
Rizqi Mauludin You're welcome
thank you very much for the tutorial! this was happen to be our project. :D big thanks!
+Marc Rabino You're welcome. Are you in university?
+DJ Oamen yes I am in a State Univ. in the Philippines to be precise hehe.
Thats awesome but when I write jtxtDisplay it shows an error..please explain...im using Netbeans 12
Change the TextField variable name to jtxtDiplay.
And why have you not subscribe to the channel Mustafa, go ahead and subscribe 👍
@@DJOamen thank u so much, sir
I watched this two years ago before I left programming and am back here to watch it again..thanks a lot
Now my issue here is my C button,Its not working..what do I do now?
jbtnCbUtton.setText("0");
or
jbtnCbUtton.setText(null);
or
jbtnCbUtton.setText("");
jTextDisplay.setText("");
(jTextDisplay = *your display variable name*)
Thank u so much
Most welcome 😊
Thanks
Welcome
Thanks a lot
You're welcome
How can we work with Decimal Point?
Thank you for this useful video :)
👍👍
thank you so much.
👍
its working 🤗
👍👍
Hello sir i really appreciate your video and i love it sir but sir there's one thing sir i can see it clearly please can you zoom it more than 18 thank you so much sir.
Ok next time
its nice video ,but dot(.) is not working as proper as the real one. when you press it 2.2.2.3,but it should work like 2.2223 does not have to accept the dot oprand reptdly.
+Adem mohammed You are not a subscriber, thumbs up and subscribe, if you want the code?
Thanx
Welcome
What is the code in C button?
C is for Clear
Check out the link below, is the latest calculator tutorial in Java
ruclips.net/video/Ym9_qF4iGHg/видео.html
Pls give Me the steps in doing it because I am going to have a exam on how to create a calculator on netbeans
Watch the video
do you have a tutorial for MDAS calculator for java netbeans?
+Sheila Rosin Yes I do, see link below: Java NetBeans Arithmetic Operator of MDAS calculatorruclips.net/video/JWXOs3tzlpY/видео.html
thanks :)
ty for this vid
Thank you 👍
how you put the decimal button working? i insert 2.2+2.2 and it gives 4 not 4.4
+Fábio Capelas Change as follows ("%.2f",result); See belowString answer;
secondnum = Double.parseDouble(jtxtDisplay.getText());
if (operations == "+")
{
result = firstnum + secondnum;
answer = String.format("%.2f",result);
jtxtDisplay.setText(answer);
}
else if (operations == "-")
{
result = firstnum - secondnum;
answer = String.format("%.2f",result);
jtxtDisplay.setText(answer);
}
else if (operations == "*")
{
result = firstnum * secondnum;
answer = String.format("%.2f",result);
jtxtDisplay.setText(answer);
}
else if (operations == "/")
{
result = firstnum / secondnum;
answer = String.format("%.2f",result);
jtxtDisplay.setText(answer);
}
else if (operations == "%")
{
result = firstnum % secondnum;
answer = String.format("%.2f",result);
jtxtDisplay.setText(answer);
}
+DJ Oamen make your int into double
Thanks for sharing im doing my system right away
That's how to learn, you made my day. Well done
I don`t understand what this is means:
answer=String.format("%.Of",result);
Could you explain?
+Валерія Нестерова ("%.Of") That is for zero decimal place. Try this out ("%.2f") and your answer will be two decimal place.
+DJ Oamen, Thank you)))
+DJ Oamen Wow, thanks for explaining this, although it didn't help me in the same way. I thought that "0f" was literally the word "Of," so I was getting unexplained errors.
Thanks man! This video helped me a lot to understand more about Java GUI and stuff... I onluy have one question. What does "%.0f" means?
+Matheus Miliorini It means zero decima place, you can change it to two decima place e.g "%.2f"
+Matheus Miliorini sent
Hi , I am sonal
I got a project from my school to make binary-decimal , octal-hex and vice versa conversion calculator, I am not getting anything how to do can you make a tutorial to help me plzz before 8th Jan 2023
See solution on the link below, and why are you not a subscriber. Good luck with your project.
How to Create Scientific Calculator in Java NetBeans
ruclips.net/video/OgtEwQWYkvo/видео.html
@@DJOamen I don't know about your channel last day only my friend suggested me your channel, so I have earlier not subscribed but now I am your subscriber 😊
@@DJOamen And thank you so much for your grateful help🙏
cannot find symbol : variable jtxtDisplay
Can u help me
That's the variable name of the TextField
thanks brother but where is clear button code plz
You can reset the textbox to as follows:
txtDisplay.clear
or
txtDisplay.Text=""
or
txtDisplay.Text="0"
Thank you so much that is so helpful ❤️
Glad it was helpful!
Where is the part of jtxtDisplay???
The JTextField is the jtxtDisplay
What is the use of becoming a member even if after becoming a member need to wait for the approval of the admin for the source code.... it is just a waste of time and money.....
Five project was sent to you this morning, although time zone may be a problem, but more than five project is very good. Check your email for all the files.
Why I can't get run the = sign, that only my problem huhu
= sign?
Mine it doesn't desplay the frame, it desplays the contents at the compiler
Check your codes
Easy tutorial, thanks!
+Justin Cromberge Thanks
Hi sir DJ can i have the codes for clearing the calculation which i C button thank you i already did all but the C button i dont know the codes :( thank you so much sirr!
+Cris Reyes jtxtDisplay.setText(null);
+DJ Oamen thank you sir i watch ur prev video and i found that codes thanks it helped me in my college project thank you so much you're awesome sir (y)
+Cris Reyes sir can u check your piano video tutorial send me the notes sir thank you so much more power to you,
Thanks for your kind words Cris. Can you forward your email to me for the Piano Notes/code and can you tell me which of the programming language piano you meant. (VB, Java, VBA, C ++, C#, Flash or Python?)
+DJ Oamen crisantoreyes1059@gmail.com that's the email prog language is java netbeans thank you for you kind sir you video tutorial isn't hard to copy awesome morepower thank you again sir your hero (y)
I have subscribed, could you please send me the source code?
+SilverNova forward your email and the video name you wanted.
+DJ Oamen Me too. Im gonna send you my email on Google +. Ok?
+DJ Oamen My email is Zexillium@hotmail.com and video name is "How to Create Calculator in Java NetBeans"
i have subscribed, and where the source code
forward your email
Thanks < 3
Thanks
divison with a comma isnt possible need help my friend
There is nothing like division with a comma. Thumbs up and subscribe, if you want the code
its not running for me
+Hazem Emad If you want the codes, forward your email
Hi ! good DAY ^_^
Can you teach me how to make a grading system in netbeans sir?
i just LOVE your video of NetbeansJava sir.
Thank you sir ^_^
+Vanessa Dahilig Do you mean an exam grading system?
code plz !!!
+Aynullah Azimi your email?
bom video,tem o link de dowload da calculadora completa ??
+Luis Cotinguiba You are not a subscriber, thumbs up and subscribe, if you want the code?
Reply ·
.
+Mohammed Bangi You are not a subscriber, thumbs up and subscribe, if you want the code?