import javax.swing.ImageIcon; import javax.swing.JOptionPane; public class Main{ public static void main(String[] args) { //JOptionPane = pop up a standard dialog box that prompts users for a value // or informs them of something. //JOptionPane.showMessageDialog(null, "This is a message dialog box", "title", JOptionPane.PLAIN_MESSAGE); //JOptionPane.showMessageDialog(null, "Here is some useless info", "title", JOptionPane.INFORMATION_MESSAGE); //JOptionPane.showMessageDialog(null, "really?", "title", JOptionPane.QUESTION_MESSAGE); //JOptionPane.showMessageDialog(null, "Your computer has a VIRUS!", "title", JOptionPane.WARNING_MESSAGE); //JOptionPane.showMessageDialog(null, "CALL TECH SUPPORT OR ELSE!", "title", JOptionPane.ERROR_MESSAGE); //int answer = JOptionPane.showConfirmDialog(null, "bro, do you even code?"); //String name = JOptionPane.showInputDialog("What is your name?: "); ImageIcon icon = new ImageIcon("smile.png"); String[] responses = {"No, you are!","thank you!","*blush*"}; int answer = JOptionPane.showOptionDialog( null, "You are the best! :D", "Secret message", JOptionPane.DEFAULT_OPTION, 0, icon, responses, responses[0]); System.out.println(answer); } }
@carsanovadidrifto8002 жыл бұрын
Hey fam, I hope that you and your loved ones are well. I would like to ask you the most important question ever asked: Who is Jesus? Not who is He to you. Rather, who is He really? Jesus is the Son of God, who came to the world as a man. He lived a perfect and sinless life . Even though He was perfect and sinless, on the cross of Calvary God wrathfully punished Him for the sins of the world. 3 days later He rose from death. Now He is seated at the right hand of God, ruling as King over Heaven and Earth. On the judgment day He will judge you, me and every human being that has ever lived. Those who believed in Him will enter eternal joy with Him, but those who did not believe in Jesus will be sent to eternal condemnation. So turn from your sins and believe in the Jesus, that you can be forgiven for all your sins, because of His death and resurrection. Acts 15:11 ”On the contrary, we believe it is through the grace of the Lord Jesus that we are saved, just as they are." Ephesians 1:7 ”In Him, we have redemption through His blood, the forgiveness of our trespasses, according to the riches of His grace" Ephesians 2:8 ”For it is by grace you have been saved through faith, and this not from yourselves; it is the gift of God,” John 11:25-26: "Jesus said to her, 'I am the resurrection and the life. The one who believes in me will live, even though they die; and whoever lives by believing in me will never die. Do you believe this?' 1 Corinthians 6:14: "And God raised the Lord and will also raise us up by his power." Romans 6:9: "We know that Christ, being raised from the dead, will never die again; death no longer has dominion over him."
@oscarjosefsson9300 Жыл бұрын
When you insert the showConfirmDialog method it looks like Eclipse creates placeholder arguments that shows what type of arguments you should give. When I insert showConfirmDialog I get: "null, args, null, 0". Is there an option to switch between these behaviours?
@subhadeepdas98142 жыл бұрын
Had zero idea about JOptionPane, came here, spent 12 mins, can code custom dialog boxes like a Pro now!!!. Thanks a lot
@pavelkvasnicka6856 Жыл бұрын
This is the best Java tutorial for beginners, so you can learn Java and English in one hit. Please keep going! I vote for Java advance tutorial. Thanks a lot Bro
@jaywest15935 ай бұрын
Had a vague understanding of this after a 2 hour class lecture. This video really helped clarify and I was able to make some boxes. Keep em' coming bro!
@johnchristianmakalintal5684 жыл бұрын
just shared your channel on facebook ;) Great tuts :D
@BroCodez4 жыл бұрын
Thanks bro! I hate to admit it, but I could use all the help I can get. Thanks again
@howcanidoit3 жыл бұрын
Great video, straight to the point! Thanks!
@youssefalaaeldin67073 жыл бұрын
A man with zero dislikes
@lateve62439 ай бұрын
Yo bro, you just help me study last minute for a midterm in one hour! thanks!
@elionayzuridasilveira41405 ай бұрын
You're awesome, teacher!
@wollyber11212 жыл бұрын
Increíble. Que genial es esta forma de mostrar mensajes en Java :D
@ValderhaugChindia Жыл бұрын
God Bless You Man!!!🙌
@deepdaddy12084 жыл бұрын
great vid bro, as always
@onoKAUTA8 ай бұрын
We need teachers like you Bro😂❤
@tarunchaudhary8543 Жыл бұрын
Very informative video bro.. And you are awesome 👍
@DreamQuestGamer3 жыл бұрын
Bro code can u tell me the settings of eclipse so that i can also get the name of the parameters as a hint ? something like below?? JOptionPane.showMessageDialog(parentcomponent, message, title , messageType);
@fredericoamigo Жыл бұрын
Once again, awesome content bro! Thank you so much for this! Keep up the good work!
@DanielOttergren Жыл бұрын
cool tutorial now i know more about joptionpane would recommend
@nagumulifrancis5057 Жыл бұрын
You're awesome indeed😊😊
@danijelmomcilovic37943 жыл бұрын
if u want play again option u can add this code in xWins and oWins, dont need to run program again :D int option=JOptionPane.showConfirmDialog(null, "Wanna play again?","Tic-Tac-Toe", JOptionPane.YES_NO_CANCEL_OPTION); if (option==JOptionPane.YES_OPTION) { frame.dispose(); new Game(); } if (option==JOptionPane.NO_OPTION || option==JOptionPane.CANCEL_OPTION) { System.exit(0); }
@Aro3o63 жыл бұрын
7:55 never before have I laughed at a code output. lmao
@dnlhrnndzr Жыл бұрын
Same xD
@justinbanza47513 жыл бұрын
Thank you for this video. very useful
@thecodingchannelph3 жыл бұрын
nice
@winterSweet-k4m4 жыл бұрын
*random comment for youtube's algorithm*
@lukashenrique4295 Жыл бұрын
lets defeat the algorithm! 😂and thank you for the video
@cuz_it_me6483 жыл бұрын
You are awesome bro !!!! Thankx
@felixnyamongo2 жыл бұрын
You are awesome. No.. You are very awesome
@Mr.-Toad Жыл бұрын
hey is there an an alternative to JOptionPane? It seems to have been removed in Java SE 20. 😑
@mr.snowbear Жыл бұрын
Verry helpful
@rachelgreen9754 Жыл бұрын
At 11:42 how can we print that option on the terminal ???
@DuongPham-bd2vr2 ай бұрын
I can't use JOptionPane despite having downloaded jdk 22 and included it in my project, can someone tell me what might have been the problem? Thank you!
@infinitepossibilities26143 жыл бұрын
Bro can you provide a link or a way to get those pngs as well? Videos are really awesome...
@runeknight28426 ай бұрын
How can display or have a showMessageDialog respond to my input, however, i also want it to continuously accept input and showinputdialog again, a while loop until i put “stop”
@crypticsios2254Күн бұрын
what is the real life application of JAVA panels, frames? the features are useful but i dont get how it can be implemented
@quyo67778 ай бұрын
awesome
@santanukumarpandapanda7588 Жыл бұрын
Thank you sir
@puppylili3 жыл бұрын
How do you get rid of the focus on the buttons in JOptionPanes? that rectangular box around the text is very annoying, thanks.
@andreaderito78713 жыл бұрын
For example you can create an array of JButtons instead of an array of Strings and you can use the setFocusable(false) method for each button. Finally, remember to pass null to the last parameter of the showOptionDialog.
@henriquefelinimena36933 жыл бұрын
thank you for the content
@Alpine385 Жыл бұрын
Bro, you are wow
@bharathpavurala78172 жыл бұрын
Made it so easy
@lisak.j70902 жыл бұрын
Amazing
@speklex779 Жыл бұрын
nice video
@Elias___ Жыл бұрын
How did you make the sub button go rainbow when you mentioned subscriptions
@jeevithabhoomireddy72613 жыл бұрын
Hi, I deployed application in one server and trying to access application in another server(through diff machine) .What i observed is dialog box is showing in the same server where i deployed not in the testing server
@_aaaadam2 жыл бұрын
thx awesome lesson
@joaquingutierrez72963 жыл бұрын
How can i custom font style of JOptionPane Title?
@sushantpatil79503 жыл бұрын
Yes I also want to know ?? Does anyone know ??
@rachelgreen9754 Жыл бұрын
At 6:48 , instead of printing a integer on the terminal, how can we print the selected option like string " yes " @BroCode
@naomicolombiaamayalovett4744 Жыл бұрын
no this has never been attempted before. Good luck
@fax672010 ай бұрын
Below int answer = JOptionPane.showConfirmDialog , you can use if else condition instead like this: if (answer == 0) { System.out.println("Yes"); } else if (answer == 1) { System.out.println("No"); } else if (answer == 2) { System.out.println("Cancel"); }
@axilprashunsrivastava36499 ай бұрын
this can be done by using if else statement
@ajaykumar_tamilan2 жыл бұрын
thank you bro
@majid18853 жыл бұрын
awesome bro, thanks
@thecodingchannelph3 жыл бұрын
nice
@duplaTraquina Жыл бұрын
where do you find the icons you use?
@ВенциТеневАй бұрын
so cool
@kemann38153 жыл бұрын
Awesome
@mehdiebrahimzadeh90323 жыл бұрын
great , tnx bro
@VersatileMC Жыл бұрын
What is the size of that smile icon?
@MrLoser-ks2xn2 жыл бұрын
Thanks
@sandramaesantos233 жыл бұрын
What eclipse do you use? I tried to download it and it just gave me a lot to choose from and I don't know which is which.
@thecodingchannelph3 жыл бұрын
just download the latest version
@developerjunior4463 жыл бұрын
Super
@toughraf84003 жыл бұрын
Bro how do you get out of that while loop? I am stuck.
@u0_a6473 жыл бұрын
stop the java program from your ide
@ibrahimylmaz83782 жыл бұрын
thanks bro
@varunpatel87893 жыл бұрын
how do u get small icons i can not find them anywhere
@ultimatelegoman12793 жыл бұрын
Beautiful!
@omersond48913 жыл бұрын
best guy#
@TrueBlueCams Жыл бұрын
thanks
@zahrapashayeva2458 Жыл бұрын
❤❤
@nawfalnjm56993 жыл бұрын
thank you
@mcflurry3242 жыл бұрын
thankss
@seahawks88013 жыл бұрын
Thanks man !
@angelcastineira25612 жыл бұрын
Thanks!
@sharalnaja94374 жыл бұрын
eclipse: u r awesome! bro: no eclipse: :( me: he is not awesome. he is a lifesaviourforabeginnerprogrammerlikemeandiwatchhisvideosformyeducationpurposesanditisgreat
@Abhi-go7vg2 жыл бұрын
Bro how to change the size ?
@adekunleibrahim8400 Жыл бұрын
The image icon covered all my screen when I ran the code
@nocontextvic61953 жыл бұрын
How did you get this icon? I tried to do the same thing on Intellij, but the icon doesn't show up
@ssrot43523 жыл бұрын
you need to copy paste the icon folder into your intellij source folder
@briman1132 жыл бұрын
Try this: ImageIcon icon = new ImageIcon(myClassName.class.getResource("/smiley.png"));
@NBF_27Ай бұрын
🎉❤
@saweranabi77862 жыл бұрын
💯👍
@joelmarkjmj Жыл бұрын
TQ
@SlothfulSage28511 ай бұрын
Drop a comment
@sandeepjadli39414 жыл бұрын
hey bro can I get code, just for academic purpose.
@BroCodez4 жыл бұрын
//whoops! I forgot to post the code lol import javax.swing.ImageIcon; import javax.swing.JOptionPane; public class Main{ public static void main(String[] args) { //JOptionPane = pop up a standard dialog box that prompts users for a value // or informs them of something. //JOptionPane.showMessageDialog(null, "This is a message dialog box", "title", JOptionPane.PLAIN_MESSAGE); //JOptionPane.showMessageDialog(null, "Here is some useless info", "title", JOptionPane.INFORMATION_MESSAGE); //JOptionPane.showMessageDialog(null, "really?", "title", JOptionPane.QUESTION_MESSAGE); //JOptionPane.showMessageDialog(null, "Your computer has a VIRUS!", "title", JOptionPane.WARNING_MESSAGE); //JOptionPane.showMessageDialog(null, "CALL TECH SUPPORT OR ELSE!", "title", JOptionPane.ERROR_MESSAGE); //int answer = JOptionPane.showConfirmDialog(null, "bro, do you even code?"); //String name = JOptionPane.showInputDialog("What is your name?: "); ImageIcon icon = new ImageIcon("smile.png"); String[] responses = {"No, you are!","thank you!","*blush*"}; int answer = JOptionPane.showOptionDialog( null, "You are the best! :D", "Secret message", JOptionPane.DEFAULT_OPTION, 0, icon, responses, responses[0]); System.out.println(answer); } }
@u0_a6473 жыл бұрын
@@BroCodez you forgor
@lroadzl12882 жыл бұрын
trolling my friends with this lol
@alexshepel55994 жыл бұрын
Nice, bro?
@spongybfdi88762 ай бұрын
👽🐸
@Kaleullo Жыл бұрын
Bro!
@greeneggsandmushrooms98553 жыл бұрын
too many options can be a pane
@Table_y Жыл бұрын
Bro
@nqobamkhaliphi5032 жыл бұрын
Broooo
@veeqqa Жыл бұрын
Exception in thread "main" java.lang.Error: Unresolved compilation problem: at myfirstprogram.Main.main (why????)