Java Swing layouts

preview_player
Показать описание
This tutorial explains layouts in Java Swing. Swing components layouts are handled with one or more layout managers. We tell the layout managers how we want our components laid out in our containers. We then add the components to our containers and let the layout managers decide the exact placement of the components.

In this video, I demonstrate a few different Swing layout managers. I then demonstrate the power of using nested containers and multiple layout managers. Finally, I show the window builder eclipse plugin which allows us to manually design our layouts with ease.

The structure of the video is as follows:
00:00 Introduction
00:40 Absolute layout
02:33 Layout managers
03:18 Flow Layout
04:28 Grid Layout
05:33 Grid bag layout
09:40 Border layout
11:56 Box layout
14:27 Card layout
17:29 JavaDoc review
17:48 Nested layout demonstration
21:04 Window Builder
22:20 Conclusion

Рекомендации по теме
Комментарии
Автор

Your ease of speaking through difficult topics and common sense approach of explaining Swing is absolutely fantastic. Thank you Dave, I have learned more of your tutorial than anywhere else.

DaveJaynes
Автор

Thankyou for this excellent series. I can't say enough about the quality and clarity of the explanations.

Miketar
Автор

Thank you found your video after being lost at web for about 3 days nice video thank you <3

manjilsapkota
Автор

I lost my sanity looking for a decent layout manager only to discover I could use the absolute layout all along! Thanks

mukynas
Автор

You're a life saver. Thank you for this very informative video!

aidrecabrera
Автор

Thank you so much for this video! I'm doing a project in my uni comp sci class and the professors expect us to learn this all ourselves, so this video really helped!!

davenfroberg
Автор

This was an excellent tutorial, thank you so much!

masterofkaarsvet
Автор

This is the best swing tutorial series! Already subbed. Thank you so much for your content!

decalsguitar
Автор

in case someone hesitate what kind of layout they should use based on Oracle site instruction:

"If you are not interested in learning all the details of layout management, you might prefer to use the GroupLayout layout manager combined with a builder tool to lay out your GUI. One such builder tool is the NetBeans IDE. Otherwise, if you want to code by hand and do not want to use GroupLayout, then GridBagLayout is recommended as the next most flexible and powerful layout manager."

wilastakurniawan
Автор

That was very helpful, i'll definitely watch the other videos!

furkankanarya
Автор

Great code and explanation. Can you put the link of project?

chavezRestricted
Автор

Hey, I hope to receive a reply. I just wanna ask how to automatically enlarge my internal components inside a panel when it is maximized —means that when I maximized my frame to its full state, the components inside the panel should follow the resizing and still stay in their current positioning as they were before it is maximized. I'm using GUI builder btw, thanks!

princekachu
Автор

I learned a lot from you. But i got a question. I have a project that uses drag and drop swing and I want to modify something but it seems that the components cannot be modified for some reason.. How do I do it using code?

pjguitar