Java Video Tutorial 23

Java Swing TutorialToday I complete the Java Swing tutorial I started in part 22 of the Java tutorial.

I implement the Swing event listeners. I then cover how to format numbers in Java so that they have commas or are displayed as currency. JOptionPane, a useful popup window in Java is introduced. And, finally I review much of what we have done in past Java Swing Tutorials.

All of the code follows the video. You should look at it to help you learn.

If you like videos like this share it [nttfblike]

Code From the Video

28 thoughts on “Java Video Tutorial 23”

  1. I use internet in a daily basis for over 12 years, and I must admit that today, I had a weird feeling! The information you provide throught your articles and videos is enormously valuable and mind-blowing, so that I want to send you 1000 dollars, just to thank you. Of course I am not rich, but I must say that this feeling is so new to me. Keep up the good work, I need more time to go deep in the knowledge which so kindly (and free) you provide to us. Keep up the good work!
    A Salut from a “poor” greek developer 🙂

    1. Thank you 🙂 It makes me very happy that you enjoy the site. Don’t ever feel obligated to donate anything. I don’t do this for money. If I did I’d cover all of my videos with pre-roll ads on YouTube.

      Sites like mine aren’t supposed to work. You’re not supposed to cover numerous topics. I’m so happy that I have the freedom to cover programming, psychology, cooking, or whatever random thing I’m interested in. I’ll soon start covering electronics, chemistry and microbiology.

      It’s a fun hobby. I’m glad other people find use in it. I’m also very happy that people all over the world seem to like it. I’m actually more popular in numerous other countries well beyond my popularity in the US.

      Thanks for taking the time to show your appreciation

      Derek

      1. Your java tutorial videos are excellent, best I’ve seen on the net.
        Do you know where I can find similar tutorial for C#.

        Thank you Derek

        1. Thank you very much. I’m glad you like them. I’m sorry, but I can’t make C# tutorials because I don’t have a PC with screencast software. C# only works on PCs and not Macs, or Linux machines. I’ve seen a bunch of C# presentations on YouTube. I’m sure you will find one there that will work. I don’t know of anyone that makes heavily edited tutorials like I do, so I can’t really recommend anyone like me. Thank you for taking the time to say Hi 🙂

  2. hii i have a question, you type one line in this code:
    JOptionPane.showMessageDialog(Practice_22.this, “Please enter the right info”, “Error”, JOptionPane.ERROR_MESSAGE);

    what is the mean of this, and why you used it here??
    “Practice_22.this”

    1. JOptionPane.showMessageDialog() is the method that opens the popup on the screen. It’s what pops up on the screen when I click on the button

  3. Hi,
    Great Videos; Rich in content. The best ever video tutorials till date I found on this amazingly connected world.

    Thanks for the videos. Videos helped me a lot.

    Again, I am thankful to you from the bottom of my heart ..!

  4. Hey again Derek (my username on here was SilentSonance), at this point in your series I decided to try and make something of my own, so I tried to create a currency converter. Everything works pretty well with it except it always executes the catch-block in the KeyListener class. I want it to update the converted amount dynamically, that’s why I have it set up the way I do. It runs just fine after the first key is pressed and the JOptionPane window is gone. If you get a chance, could you look over the source code real quick?

    https://github.com/mball14/Currency-Converter/blob/master/.gitignore

    Thank you again (I’m SilentSonance on YouTube) so much for all these tutorials, I feel like I’m learning a ton.

  5. Hi again. Two issues I’m having with this tutorial:

    in the action listener if statement right after the catch, netbeans says that it’s expecting two doubles not two doubles and the ‘howMany’ int.

    int the addNumbers, subtractNumbers etc methods I’m getting errors but I think it’s the same problem… Netbeans wants another parenthesis where it shouldn’t. It also no longer likes the return statement saying its not necessary.

    I have double checked the code but cannot see an error. If this isn’t enough info I’ll paste it in.

    If you have the time I’d be grateful for the help.

  6. I hit a snag with the Regular Expressions, but picked it back up with Swing. Can’t wait to work on some text based games later on!

  7. at line 253 and elsewhere, i notice that NumberFormat never uses the “new” keyword. why is that? i thought “new” was used whenever you were not dealing with a primitive variable. i tried it with “new” and got an error : )
    thanks for your very excellent work derek.

  8. I can never thank you enough. It is something I have to deal with everyday but programming is not taught very well in a lot of universities, mine in that category. But the video and audio combination is just perfect. The speed, the tone, the content are all perfect Derek. It’s just what I and millions of other people need and you are the man to give it to us!

    Thank you!

    1. Thank you very much for taking the time to tell me that I help 🙂 I very much appreciate that. I will continue making tutorials for as long as possible and they will always be free.

  9. Hey, first off I want to say that you are doing a great job. There is something that I feel will help out everyone though. I feel that you should teach proper formatting and organization of code. Getting people used to grouping certain objects is going to help them so much in the long run. I am following you tutorials but just using my own organization. In the long run it will help people write better code and it is easier to edit the program if need be. Once again great work on these tuts, sorry if this comment doesn’t really matter because the video is over a year old. Just thought I would put my time in to give you some feedback for all the time you put in for us 😀 Thanks!

  10. wow the best video tutorial i have seen in ages i am new to java and i actually have done away with books your explaining makes it pretty easy to understand and it makes learning fun

  11. I finally managed to fix it and do what you did, but i get a .jar file not a .exe file, so windows users will have to right click select open with java SE binary – a real pain.

  12. I fixed it thanks for your amazing videos they are incredibly helpful.

    p.s. im gonna get a brain aneurysm soon from too much thinking

Leave a Reply

Your email address will not be published. Required fields are marked *