Тёмный

Java calculator app 🖩 

Bro Code
Подписаться 2 млн
Просмотров 409 тыс.
50% 1

Java simple calculator program w/ GUI
#Java #calculator #app
(NOT A COMPLETE CALCULATOR)

Наука

Опубликовано:

 

11 июл 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 470   
@BroCodez
@BroCodez 4 года назад
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
@vickysanth9653
@vickysanth9653 3 года назад
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..
@sidra3210
@sidra3210 3 года назад
Nice👍🔥
@shokirovblog
@shokirovblog 3 года назад
@@komaltandle465 LOL
@agent47hitman75
@agent47hitman75 3 года назад
@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.
@medjl6083
@medjl6083 3 года назад
@NOA777 The method parseDouble() of wrapper class Double, convert string to double.
@deepeshsingh7717
@deepeshsingh7717 4 года назад
People are missing out on your amazing content. I am still learning Java, and your content helps a lot.
@Bryysanity
@Bryysanity 6 месяцев назад
how are you now on your Java journey?
@kylewc2286
@kylewc2286 4 месяца назад
​@@Bryysanity Im curious too
@StefaanMeeuws
@StefaanMeeuws 2 года назад
Most impressive. Very lucid coding. Congrats on teaching me a little more than I knew!
@ashkaneghbali2702
@ashkaneghbali2702 2 года назад
Came here straight after the 12 hour java tutorial. You are Awesome Bro. Keep 'em coming :)
@Sorjen108
@Sorjen108 2 года назад
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
@milesmiller9588
@milesmiller9588 3 года назад
Started practice with GUI's and this helped a lot!
@AnsarAbbas-ed5ig
@AnsarAbbas-ed5ig 2 года назад
off course same here bro😎
@EbbieMonch
@EbbieMonch 2 года назад
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
@zul_afluz
@zul_afluz Год назад
Extremely helpful. Got my mini project done within 30 minutes referring your source code and guide. Thankkksss a lotttt ☺👏
@alessandroformica6824
@alessandroformica6824 3 года назад
Thank you, Bro! My prayers to the algorithm.
@rasisulhubbi9316
@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
@karllouiserito4777
@karllouiserito4777 3 года назад
Thanks Bro I've learned something new today about Java especially that GUI.
@slonbeskonechen8310
@slonbeskonechen8310 3 года назад
Please, don't stop!!! More and more tutorials!!!!
@Zito_from_OHIO
@Zito_from_OHIO Месяц назад
the first sentence (Please, don't stop!!) remember me of a chat i had i chai 😏😏
@flyetimadtravel2157
@flyetimadtravel2157 3 года назад
Bro You are legend. I am not a student I started learning JAVA to make my travel agency CRM.
@parkashkumar765
@parkashkumar765 2 года назад
You always perfect sir because your way of teaching is all the time perfect. Thank you so much sir.🥰
@ChinmayaHelchel
@ChinmayaHelchel 2 года назад
Thank you @BroCode ☺ It was really up to the point !
@kumarkelash4423
@kumarkelash4423 3 года назад
you are really a great teacher you have made my life easy hahahah... God bless you sir
@mohammedhh6488
@mohammedhh6488 2 года назад
Thank you very much for your assistance, you explained the code perfectly. Thumb Up.
@bellabrink8610
@bellabrink8610 2 года назад
Amazing content as always man, thank you!
@mansinaidu
@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 .
@westonpeabody8010
@westonpeabody8010 2 года назад
Thanks man. Believe it or not Ive been learning Java for years and until now Ive never actually wrote a fully functional calculator.
@gyangaha109
@gyangaha109 3 года назад
yo bro, love it thanks keep up the good work
@manthanpatki146
@manthanpatki146 3 года назад
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.
@alirezahassanieghtedar5010
@alirezahassanieghtedar5010 2 года назад
Thanks a million , It was really nice and perfect for a beginner like me
@BlueOrcas
@BlueOrcas Год назад
I knew bro couldn't miss the negative sign before. He just cares for us bros and was testing us to grow stronger💪
@secretchannel2151
@secretchannel2151 3 года назад
You are a true Bro. Thank you very much sir! Everyone keep commenting, liking and subbing to help the algorithm!
@365motivation.9
@365motivation.9 Год назад
Bro code,this is an amazing tutorial.Thank you Mann,you taught me alot here.
@wolanus
@wolanus 3 года назад
Another great video. Thanks!
@noah77
@noah77 4 года назад
Cool, this is nice. Awesome video. And also, I have finished creating my AI ChatBot!!
@BroCodez
@BroCodez 4 года назад
nice! Which app is it for?
@BigBadBicycle
@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.
@suaddacic7728
@suaddacic7728 3 года назад
Thanks man You explain java better than my teacher
@glebignites5278
@glebignites5278 3 года назад
Thank you very much! It was very helpful.
@omersond4891
@omersond4891 3 года назад
very helpful video. i understand for loops, if() more than before
@ManuelErica
@ManuelErica День назад
You're the man. Good job!
@ThunderHockeyTFL
@ThunderHockeyTFL 2 года назад
big thanks, very helpful video! subbed
@orlandohunter2785
@orlandohunter2785 3 года назад
Bro! These videos are awesome 👏
@B_lla008
@B_lla008 Год назад
thanks for clean work it really help me !you are super good :)
@alvydagr8108
@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
@FukSN
@FukSN 2 года назад
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?
@kemann3815
@kemann3815 2 года назад
Amazing video. That robotic laugh at the end got me 😂
@grenadine9448
@grenadine9448 3 года назад
Awesome content !
@YaroMalik
@YaroMalik 4 месяца назад
Bro the goat. Just finished learning Java with you and am building my first project with you too
@Respects103
@Respects103 4 месяца назад
best yt for coding i learned many things from you thanks you so much bro code
@Baltazar_Gunar
@Baltazar_Gunar 2 года назад
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.
@ahmedshifa
@ahmedshifa Год назад
Amazing content, thank you!
@meguminsatou1591
@meguminsatou1591 9 месяцев назад
man Thank you i really need this tutorial for my computer programming 2
@ryanning4516
@ryanning4516 3 года назад
awwwwwwwwwwwsome video bro!!! I subscribed to your channel!!! and I learned a lot! and can you make a pokemon type of tutorial?
@BroCodez
@BroCodez 3 года назад
haha my latest video on FileReaders is pokemon themed actually lol
@letsgame108
@letsgame108 Год назад
Thank you so much bro. this is really amazing
@mohdaman5928
@mohdaman5928 2 года назад
i truly learn a lot man thanks
@thebeginner613
@thebeginner613 2 года назад
Polich machaa.. You are great 👏🏻👏🏻
@ShahzadKhan-jg3hl
@ShahzadKhan-jg3hl 2 года назад
Well defined. Thank you.
@gabrielvalentin3106
@gabrielvalentin3106 2 года назад
Excellent as always bro!
@fmsabisai
@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.
@yasarcarel
@yasarcarel 3 месяца назад
if(e.getSource() == decButton) { if(textfield.getText().contains(".")) { String temp = textfield.getText(); textfield.setText(""); for(int i=0;i
@incarnateblizzard4874
@incarnateblizzard4874 2 часа назад
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
@user-mk8mj2pe2j
@user-mk8mj2pe2j 6 месяцев назад
Very cool! Helped me alot!
@konsti02
@konsti02 3 года назад
this is great! Thank you
@athenkosinyombolo4275
@athenkosinyombolo4275 3 года назад
This was really helpful
@biplobahmed6509
@biplobahmed6509 Год назад
no caption king. learned a lot from you . thnaks for the quality content
@mahaalibrahim7934
@mahaalibrahim7934 3 года назад
That’s was a lot of code thanks for your effort
@helpdesk9535
@helpdesk9535 3 года назад
Thanks for the help Big Bro!
@irizjuh1321
@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
@brianpelarez
@brianpelarez Год назад
Good day BRO! Thanks so much I can now code my simple calculator, through your tutorial.
@reo4465
@reo4465 2 года назад
Thank you so much for making this wonderful vidoes ❤️
@rudranagariya8546
@rudranagariya8546 3 года назад
Thank you so much bro you are the only best coder
@djziomsuper
@djziomsuper 3 года назад
Great video!
@shibildas
@shibildas Год назад
Bro, that was awesome ❤️
@divyakale1271
@divyakale1271 9 месяцев назад
Thanks Wonderful video ! This video is easy to understand and very helpful.
@Sapocrate
@Sapocrate 2 года назад
Thanks! (I appreciate also the 420 on the preview)
@user-qe5pk6ke3k
@user-qe5pk6ke3k 3 года назад
awesome broo..keep rocking
@muhammadbsoul1459
@muhammadbsoul1459 Год назад
Thanks pro Very helpful video Keep going
@ThePraQNome
@ThePraQNome Год назад
Great tutorial, thank you.
@coolboy.bladersshow9159
@coolboy.bladersshow9159 3 года назад
Thanks bro. You helped me a lot.
@ashnasanam217
@ashnasanam217 2 года назад
Underrated!
@Mia_sarahia_kit_official
@Mia_sarahia_kit_official Год назад
thank you so much bro code it help me a lot when i watch your vedio. love yah
@abdialemu8391
@abdialemu8391 Год назад
you are a hero!
@manasapanda9248
@manasapanda9248 2 года назад
Amazing video I really enjoy this as this is very useful in my program
@Gaminiheraliyawala
@Gaminiheraliyawala 9 месяцев назад
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..... 👌👌👍👍
@JEE-nf1cv
@JEE-nf1cv 6 месяцев назад
This was indeed Helpful brother Thanks for the tutorial
@animegaming7116
@animegaming7116 5 месяцев назад
the package come back as error what to do
@hamadareda1695
@hamadareda1695 3 года назад
thank you this is relly amazing
@Ahmad-jc7by
@Ahmad-jc7by Год назад
so enjoyable, thanks for this Man
@stanislavdimitrov1643
@stanislavdimitrov1643 11 месяцев назад
Great, fantastic. It may seem a little but too advanced at the beginning, but you can try it and see:)
@Dejuk22
@Dejuk22 Год назад
well done bro🙌 thank you!!
@MatheusOliveira-me3rf
@MatheusOliveira-me3rf Год назад
thank you man!!
@user-ot2sn1cn3e
@user-ot2sn1cn3e Год назад
great example. Thanks
@kampfer6375
@kampfer6375 2 года назад
Very well explained 👍
@cutie3127
@cutie3127 9 месяцев назад
Your amazing Content makes me to passionate about java more... I thought to left but ...
@wolfhans2122
@wolfhans2122 Год назад
thank you for your work.
@retro9794
@retro9794 3 года назад
Thank you!
@ritikrajput2894
@ritikrajput2894 Год назад
Wonderful Tutorial
@Daniel78852
@Daniel78852 2 года назад
Thanks man that helped a lot. Nw I see how Java works.
@chiyuzhang3089
@chiyuzhang3089 Год назад
Thanks Bro, great video!
@infotechlab
@infotechlab Год назад
hey bro! thanks a lot for this amazing content..
@lucianodiaz298
@lucianodiaz298 Год назад
I liked very much this video and i from Buenos Aires, Argentina
@omeraran9398
@omeraran9398 2 года назад
I love your channel.
@quikmath8071
@quikmath8071 2 года назад
Awesome tutorial
@Wisdom-Thoughts
@Wisdom-Thoughts 6 месяцев назад
Amazing!
@dongnez
@dongnez 3 года назад
It's a good video but I think it would be better if you use layouts to auto realignment. Pd: Good video, sorry for my English.
@Mario-cz6tr
@Mario-cz6tr Год назад
hey dude what is that if you wouldn't bother explaining, (in whichever lenguage you want)
@anilsilwal1773
@anilsilwal1773 2 года назад
Great teaching
@ryandavis710
@ryandavis710 3 года назад
Great tutorial
@joshuaraymond4996
@joshuaraymond4996 2 года назад
man, I loved it.
@soumelee5661
@soumelee5661 Год назад
thanks bro for this video!! very helpful :)
@raviratnakar3803
@raviratnakar3803 3 года назад
You make it look very easy. Thanks Bro!
Далее
Java login system 👨‍💻
30:36
Просмотров 301 тыс.
Build this JS calculator in 15 minutes! 🖩
15:20
Просмотров 417 тыс.
Телеграмм-Колян Карелия
00:14
Просмотров 321 тыс.
ПАПА ГАМБУРГЕР
00:13
Просмотров 107 тыс.
Java GUI Tutorial - Make a Login GUI #100
19:49
Просмотров 549 тыс.
Making a Game in Python with No Experience
5:57
Просмотров 1,6 млн
31 nooby C++ habits you need to ditch
16:18
Просмотров 741 тыс.
Why You Shouldn't Nest Your Code
8:30
Просмотров 2,6 млн
8 patterns to solve 80% Leetcode problems
7:30
Просмотров 236 тыс.
Java HashMap 🗺️
13:05
Просмотров 77 тыс.
Java GUI Tutorial - Make a GUI in 13 Minutes #99
12:58
Choose a phone for your mom
0:20
Просмотров 6 млн
Треш ПК за 420 000 рублей
0:59
Просмотров 108 тыс.