Java simple calculator program w/ GUI #Java #calculator #app (NOT A COMPLETE CALCULATOR)
Пікірлер: 475
@BroCodez4 жыл бұрын
import javax.swing.*; import java.awt.*; import java.awt.event.*; public class Calculator implements ActionListener{ JFrame frame; JTextField textfield; JButton[] numberButtons = new JButton[10]; JButton[] functionButtons = new JButton[9]; JButton addButton,subButton,mulButton,divButton; JButton decButton, equButton, delButton, clrButton, negButton; JPanel panel; Font myFont = new Font("Ink Free",Font.BOLD,30); double num1=0,num2=0,result=0; char operator; Calculator(){ frame = new JFrame("Calculator"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setSize(420, 550); frame.setLayout(null); textfield = new JTextField(); textfield.setBounds(50, 25, 300, 50); textfield.setFont(myFont); textfield.setEditable(false); addButton = new JButton("+"); subButton = new JButton("-"); mulButton = new JButton("*"); divButton = new JButton("/"); decButton = new JButton("."); equButton = new JButton("="); delButton = new JButton("Del"); clrButton = new JButton("Clr"); negButton = new JButton("(-)"); functionButtons[0] = addButton; functionButtons[1] = subButton; functionButtons[2] = mulButton; functionButtons[3] = divButton; functionButtons[4] = decButton; functionButtons[5] = equButton; functionButtons[6] = delButton; functionButtons[7] = clrButton; functionButtons[8] = negButton; for(int i =0;i
@vickysanth96533 жыл бұрын
it would be more easy to understad for beginners like me if you go slower than usual.. because i don't understand many terms like "ActionListener", interfaces etc.. it's like new to me since I'm a beginner..
@sidra32103 жыл бұрын
Nice👍🔥
@shokirovblog3 жыл бұрын
@@komaltandle465 LOL
@agent47hitman753 жыл бұрын
@NOA777 the method Double.parseDouble() casts a value to a double type value. the getText() method is used to get the text from the text field. So Double.parseDouble(txtfield.getText()) is actually casting the string values to a double type value of whatever is written in the rext field as we can't perform calculation with string type of values.
@medjl60833 жыл бұрын
@NOA777 The method parseDouble() of wrapper class Double, convert string to double.
@deepeshsingh77174 жыл бұрын
People are missing out on your amazing content. I am still learning Java, and your content helps a lot.
@Bryysanity7 ай бұрын
how are you now on your Java journey?
@kylewc22865 ай бұрын
@@Bryysanity Im curious too
@StefaanMeeuws2 жыл бұрын
Most impressive. Very lucid coding. Congrats on teaching me a little more than I knew!
@ashkaneghbali27022 жыл бұрын
Came here straight after the 12 hour java tutorial. You are Awesome Bro. Keep 'em coming :)
@EbbieMonch2 жыл бұрын
This tutorial was very good and even gave the challenge of fixing the Delete and Clear font size while keeping the rest of the numbers and functions font the same size
@milesmiller95883 жыл бұрын
Started practice with GUI's and this helped a lot!
@AnsarAbbas-ed5ig2 жыл бұрын
off course same here bro😎
@rasisulhubbi9316 Жыл бұрын
I just start learning java a month ago and a little bit confuse what to do, and i found your channel, its really help me to practice
@zul_afluz Жыл бұрын
Extremely helpful. Got my mini project done within 30 minutes referring your source code and guide. Thankkksss a lotttt ☺👏
@ChinmayaHelchel2 жыл бұрын
Thank you @BroCode ☺ It was really up to the point !
@Sorjen1082 жыл бұрын
This channel is so underrated I went through many tuto on youtube, but none of them was that good(sincerely), and this is in regards to any programming language This developer is Gold
@bellabrink86102 жыл бұрын
Amazing content as always man, thank you!
@karllouiserito47773 жыл бұрын
Thanks Bro I've learned something new today about Java especially that GUI.
@mansinaidu Жыл бұрын
bro this was really awesome .... my sir told it but it was too confusing but your program was clean and neat.... thank you so much .
@alessandroformica68243 жыл бұрын
Thank you, Bro! My prayers to the algorithm.
@parkashkumar7652 жыл бұрын
You always perfect sir because your way of teaching is all the time perfect. Thank you so much sir.🥰
@manthanpatki1463 жыл бұрын
well I am just commenting to support you because this video has been really helpful and i learnt more ways to use GUI in java.
@365motivation.9 Жыл бұрын
Bro code,this is an amazing tutorial.Thank you Mann,you taught me alot here.
@gyangaha1093 жыл бұрын
yo bro, love it thanks keep up the good work
@mohammedhh64882 жыл бұрын
Thank you very much for your assistance, you explained the code perfectly. Thumb Up.
@suaddacic77283 жыл бұрын
Thanks man You explain java better than my teacher
@westonpeabody80102 жыл бұрын
Thanks man. Believe it or not Ive been learning Java for years and until now Ive never actually wrote a fully functional calculator.
@kemann38152 жыл бұрын
Amazing video. That robotic laugh at the end got me 😂
@kumarkelash44233 жыл бұрын
you are really a great teacher you have made my life easy hahahah... God bless you sir
@alirezahassanieghtedar50102 жыл бұрын
Thanks a million , It was really nice and perfect for a beginner like me
@slonbeskonechen83103 жыл бұрын
Please, don't stop!!! More and more tutorials!!!!
@Zito_from_OHIO2 ай бұрын
the first sentence (Please, don't stop!!) remember me of a chat i had i chai 😏😏
@BigBadBicycle Жыл бұрын
I just begun with Java and made my own calculator like this. But after finishing and seeing this video, there is a lot of things I could do to definetly reduce my code size.
@BlueOrcas Жыл бұрын
I knew bro couldn't miss the negative sign before. He just cares for us bros and was testing us to grow stronger💪
@orlandohunter27853 жыл бұрын
Bro! These videos are awesome 👏
@flyetimadtravel21573 жыл бұрын
Bro You are legend. I am not a student I started learning JAVA to make my travel agency CRM.
@alvydagr8108 Жыл бұрын
Wow even though your style is different, its super easy to understand and frankly, might make me do my calculator over just because It seems easier the way you did it
@wolanus3 жыл бұрын
Another great video. Thanks!
@grenadine94483 жыл бұрын
Awesome content !
@glebignites52783 жыл бұрын
Thank you very much! It was very helpful.
@athenkosinyombolo42753 жыл бұрын
This was really helpful
@ManuelErica23 күн бұрын
You're the man. Good job!
@ShahzadKhan-jg3hl2 жыл бұрын
Well defined. Thank you.
@ahmedshifa Жыл бұрын
Amazing content, thank you!
@YaroMalik5 ай бұрын
Bro the goat. Just finished learning Java with you and am building my first project with you too
@ThunderHockeyTFL2 жыл бұрын
big thanks, very helpful video! subbed
@secretchannel21513 жыл бұрын
You are a true Bro. Thank you very much sir! Everyone keep commenting, liking and subbing to help the algorithm!
@Respects1035 ай бұрын
best yt for coding i learned many things from you thanks you so much bro code
@mohdaman59282 жыл бұрын
i truly learn a lot man thanks
@B_lla008 Жыл бұрын
thanks for clean work it really help me !you are super good :)
@omersond48913 жыл бұрын
very helpful video. i understand for loops, if() more than before
@meguminsatou159110 ай бұрын
man Thank you i really need this tutorial for my computer programming 2
@FukSN3 жыл бұрын
Thanks Bro !! These tutorials are nice and quick to run through and show beginners like me how certain code works in a real app. I find this more valuable than just a lesson on certain things like arrays. I have noticed a slow down on the java vids, any chance of any new quick app tutorial vids?
@biplobahmed6509 Жыл бұрын
no caption king. learned a lot from you . thnaks for the quality content
@gabrielvalentin31062 жыл бұрын
Excellent as always bro!
@thebeginner6132 жыл бұрын
Polich machaa.. You are great 👏🏻👏🏻
@fmsabisai Жыл бұрын
This is an amazing tutorial, thumbs up. I would have loved to see how you handled division by 0. I have also noticed that its possible to have multiple dots in a number which would result in an error during calculations.
little bit late, but came across the tutorial right now. for multiple dots I did (most likely theres a better solution): if(e.getSource() == decButton) { boolean alrDec = false; for(int i = 0; i
@konsti023 жыл бұрын
this is great! Thank you
@mahaalibrahim79343 жыл бұрын
That’s was a lot of code thanks for your effort
@user-mk8mj2pe2j7 ай бұрын
Very cool! Helped me alot!
@helpdesk95353 жыл бұрын
Thanks for the help Big Bro!
@ThePraQNome Жыл бұрын
Great tutorial, thank you.
@brianpelarez Жыл бұрын
Good day BRO! Thanks so much I can now code my simple calculator, through your tutorial.
@Baltazar_Gunar2 жыл бұрын
i just finish second book about java. A Beginners Guide and Complete Reference from Herbert SCHİLDT. I was looking for an example of real GUI software that wasn't beyond my knowledge and actually did something. So I could get an idea of the general programming structure. Your video help me a lot about this. Thank you.
@Sapocrate2 жыл бұрын
Thanks! (I appreciate also the 420 on the preview)
@Dejuk22 Жыл бұрын
well done bro🙌 thank you!!
@reo44652 жыл бұрын
Thank you so much for making this wonderful vidoes ❤️
@etude594220 күн бұрын
Thank you so much for the perfect explanation ❤❤❤❤😭
@shibildas Жыл бұрын
Bro, that was awesome ❤️
@Ahmad-jc7by Жыл бұрын
so enjoyable, thanks for this Man
@djziomsuper3 жыл бұрын
Great video!
@kampfer63752 жыл бұрын
Very well explained 👍
@user-qe5pk6ke3k3 жыл бұрын
awesome broo..keep rocking
@letsgame108 Жыл бұрын
Thank you so much bro. this is really amazing
@LiyaAi-fm9ec7 сағат бұрын
Very beautiful, Love it!
@quikmath80712 жыл бұрын
Awesome tutorial
@noah774 жыл бұрын
Cool, this is nice. Awesome video. And also, I have finished creating my AI ChatBot!!
@BroCodez4 жыл бұрын
nice! Which app is it for?
@JEE-nf1cv6 ай бұрын
This was indeed Helpful brother Thanks for the tutorial
@animegaming71166 ай бұрын
the package come back as error what to do
@manasapanda92482 жыл бұрын
Amazing video I really enjoy this as this is very useful in my program
@user-ot2sn1cn3e Жыл бұрын
great example. Thanks
@Daniel788522 жыл бұрын
Thanks man that helped a lot. Nw I see how Java works.
@muhammadbsoul1459 Жыл бұрын
Thanks pro Very helpful video Keep going
@coolboy.bladersshow91593 жыл бұрын
Thanks bro. You helped me a lot.
@divyakale12719 ай бұрын
Thanks Wonderful video ! This video is easy to understand and very helpful.
@ryandavis7103 жыл бұрын
Great tutorial
@rudranagariya85463 жыл бұрын
Thank you so much bro you are the only best coder
@ashnasanam2172 жыл бұрын
Underrated!
@ritikrajput2894 Жыл бұрын
Wonderful Tutorial
@raviratnakar38033 жыл бұрын
You make it look very easy. Thanks Bro!
@cutie312710 ай бұрын
Your amazing Content makes me to passionate about java more... I thought to left but ...
@MatheusOliveira-me3rf Жыл бұрын
thank you man!!
@stanislavdimitrov164311 ай бұрын
Great, fantastic. It may seem a little but too advanced at the beginning, but you can try it and see:)
@infotechlab Жыл бұрын
hey bro! thanks a lot for this amazing content..
@wolfhans2122 Жыл бұрын
thank you for your work.
@Mia_sarahia_kit_official Жыл бұрын
thank you so much bro code it help me a lot when i watch your vedio. love yah
@ryanning45163 жыл бұрын
awwwwwwwwwwwsome video bro!!! I subscribed to your channel!!! and I learned a lot! and can you make a pokemon type of tutorial?
@BroCodez3 жыл бұрын
haha my latest video on FileReaders is pokemon themed actually lol
@Gaminiheraliyawala10 ай бұрын
Dear Bro you are simply amazing... ❤❤💐💐being sooo... generous in sharing your wealth of knowledge and you certainly deserve a very big appreciation for making me impressed to learn Java programming. God Bless You Bro...🙏🙏. I really loved it and impatient to try it ASAP..... 👌👌👍👍
@rsdigiomoney Жыл бұрын
I followed through this whole tutorial on Linux with text editor and terminal Javac compiling (no IDE!) and it worked flawlessly even when packaged into a jar file. I feel like I learned stuff but even if I didn’t, I at least understand how the program works and it was fun to feel like I’m coding stuff just by following along
@omeraran93983 жыл бұрын
I love your channel.
@irizjuh1321 Жыл бұрын
Wonderful video! This series has been really helpful in training my way of thinking too! Sometimes I pause the video and finish the line or piece of code before starting the video again so I can check it. Thank you so much for the effort! For the delete-button Action-listener, I wrote these alternative lines btw. if(e.getSource()==delButton) { textField.setText(textField.getText().substring(0,(textField.getText().length() - 1))); } It takes the text in the textfield and replaces it with a substring that leaves out the last index. This way you don't need to create a for-loop and you can do it with one line instead! I really learned this way of thinking through practicing with your videos - so thanks a lot! :D