Java Video Tutorial 28

Get the Code:

In this part of my Java Video Tutorial, I cover 3 different Swing layout managers. I revisit the the layout manager we have been using by default being Flow Layout. As well I introduce the Border and Box layout managers.






48 responses to “Java Video Tutorial 28”

  1. ChrisN98 Avatar

    Excellent video well explained thanks again. Subscribed!

  2. Sascha Jung Avatar

    Dang I wish I found this when I was still at University… I thank you very much for your videos. This is probably the best channel on youtube…regarding not only the quality but also the diversity of knowledge you can obtain here…keep on the great work! We need more people like you..long story short: subscribed 😀

  3. Galacticore Avatar

    Do you have a JavaFX series, or plan on doing one? I just learned the basics elsewhere (but I prefer your tutorials).

    Edit: I looked, albeit not hard, for FX videos on your channel but didn't see any.

  4. GobblowGalaxyGamer Avatar

    "Does anyone see this message :)" Yes I do Derek!

  5. alias40anon Avatar

    I wonder if all the great graphic interface in apps and OS are build with thousands of code like that? I suppose yes but with many languages and not only java?

  6. Stepan Lenevich Avatar

    How to control behavior of individual JPanes on resizing?
    Assume you have a frame that should have 9 fields "JTextArea" aligned vertically. [Lets say you make a JPaneAll, containing northJPane, centerJPane, and southJPane each contain JTextArea in their NORTH, CENTER, and SOUTH fields]. Now, you want the vertical size of JTextArea3 and JTextArea8 to change on resize, while the other JTextAreas should not change on vertical resize. How to achieve it?
    What if for each 10 pixels of size increase JTextArea3 and JTextArea8 should gain 3 and 7 pixels of height, respectively?
    Thank you for great tutorials!

  7. Fanny Lebowski Avatar

    just perfect ! like always !

  8. no hEal Avatar

    great tutorial. Our professor dumped Swing topic on us just last week. It's hard to grasp firsthand. Thanks for your tutorials, helped me a lot

  9. TMS - C Avatar

    border layout doesnt work for me, the buttons just dont show up
    edit: flow layout doesnt work too, i bet the third one wont work too..

    ANY HELP?!

  10. Symix Avatar

    Derek u like teen wolf? XD

  11. Silas Mcfarlane Avatar

    When I don't have a computer with me to write code…. After you explain what your gonna do I say out loud what you are gonna type before you type it! That is a way I learn when there is no computer handy!!! I really love your videos! Ps I am 12 years old!

    Do you think learning when you are young is a good thing for Java programming??

  12. Amadeus Zittel Avatar

    For which Layouts you use the addComp()  method?

  13. baraa aljabban Avatar

    thank you 
    you are good man

  14. Gabriel Urtado Avatar

    Hi Dereck, Thanks for the videos!!
    I have a question: is there some library or something that we can do a program exactly the way we want, like changing the color of the background? 

  15. TheWombatGuru Avatar

    My Eclipse suddenly gives errors at every line that uses a J thing component like JButton, how to fix this?

  16. channel21060 Avatar

    Great job.  I found java series from a bunch of guys who sounded stoned and a great lady Barbara Hecker.  You're in my top 2 now.  Thanks for not sounding stoned. 

  17. Cocain Monster Avatar

    I really appreciate these videos man, Really helped me out

  18. Shakeeb Ayaz Avatar

    hi Derek when are u going to start J2ee and framework

  19. Derek Banas Avatar

    Thank you 🙂 Yes I cover collections in this tutorial and then I also create them from scratch in my Java Algorithms tutorial. Here is my whole Java Tutorial on one page newthinktank. com/videos/java-video-tutorial/

  20. Timothy Leung Avatar

    Hi! Great Vidoes! Do you have tutorials about the java Collection? Good way to use List, Stack, etc?

  21. Devin Lafford Avatar

    I saw the message 🙂

  22. GinAndBamba Avatar

    Hi Derek,

    I had a doubt. If you go to minute 1:30, you're calling a new object of class FlowLayout. Is that a shorthand way? Would that be equal to:

    FlowLayout fl = new FlowLayout(FlowLayout.LEFT);

    Thanks so much, I feel like a pro programmer since i started watching your videos a few days ago xD

  23. Lawr Leaf Avatar

    Nice :). Can't wait to get onto them! Btw thanks for the staggeringly quick replies, and I'm really enjoying the tuts so far!

  24. Derek Banas Avatar

    Yes pretty much. The object oriented design, design patterns, refactoring and uml tutorials would be considered more advanced topics. I don't think most of those topics are even covered in college. The OOD tutorial was my favorite. I hope they help 🙂

  25. Lawr Leaf Avatar

    Derek, would just like to ask: are the 93 java tutorials in this playlist defined as the 'core' java material. I've noticed you don't have any of the 'Java Algorithm' or 'Android Dev.' tutorials included in this playlist.

  26. Derek Banas Avatar

    Great I'm glad you fixed it 🙂

  27. Christopher Matthews Avatar

    Derek I found the problem and your code examples work as described. The problem was I accepted (using the auto complete) the following line JPanel thePanel = new JavaPanel();
    Still need to find out what JavaPanel does that JPanel does not.

  28. Christopher Matthews Avatar

    Yep. I have discovered that my application seems to use the BorderLayout by default. I don't need to set Border Layout but using a BoarderLayout.BOTTOM for example to an add JLabel works straight off. If I don't set any layout mode everything just stacks on top of each other in the same place.

  29. Derek Banas Avatar

    Did you see the code I have on my site goo. gl/AX7WS

  30. Christopher Matthews Avatar

    When I entered setLayout(FlowControl …..) and I run my test program I get a border at the top of the frame with text asking if I want to view my run time options. My components appear below that. If I don't use the setLayout method everything appears in a single place in the frame. How do do get round this run time message appearing?

  31. Derek Banas Avatar

    Yes you can do that. I do much more with swing as the tutorial continues

  32. Matthew Garber Avatar

    I know it's less comman but can you add a vertical box to a panel which is on the east or west side of a border layout

  33. Derek Banas Avatar

    You're very welcome 🙂 Always feel free to ask questions.

  34. Derek Banas Avatar

    You're very welcome 🙂 In this tutorial I show how to make a Java paint application. I think that might be what you are looking for. I hope it helps

  35. Gulzt Avatar

    About the BorderLayout, I like to add that it isn't necessary to declare it using setLayout.
    You can leave it out and it will still show the same behaviour, as long as you place the components using add(componentName, BorderLayout.NORTH);

    At least, I can't find any differences in behaviour (I'm just a rookie though)

  36. Derek Banas Avatar

    You're very welcome 🙂

  37. sandeep panwar Avatar

    Thank you Derek million times 🙂

  38. Derek Banas Avatar

    Thank you very much 🙂 He is pretty much the king of tutorials so that is high praise

  39. Matthew Ball Avatar

    Khan is great, I used his tutorials to learn Organic Chemistry and some Calculus… but he doesn't have any Java videos! And if he did, they wouldn't be as good as these.

  40. Derek Banas Avatar

    Thank you, but I doubt I'll ever be nearly as popular as Khan. He is the king of tutorials. I am but a peasant

  41. Derek Banas Avatar

    If I mention homework I normally just state a simple way to add to the program. I have a link to the code in the description

  42. Derek Banas Avatar

    Keep watching the videos. It is covered. Take a look at my java playlist on my yt channel. It will be easy to find

  43. James Cleary Avatar

    Any chance of a comprehensive guide to working with GridBagLayout ?

  44. Smoking Crop Avatar

    great, no grid layout :/

  45. Derek Banas Avatar

    I get to that and much more later in the tutorial

Leave a Reply

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