Trail: Creating a GUI With JFC/Swing
Lesson: Laying Out Components Within a Container
How to Use Various Layout Managers
Home Page > Creating a GUI With JFC/Swing > Laying Out Components Within a Container

How to Use Various Layout Managers

Each of the following pages describes how to use a particular kind of layout manager. Another way to get to these pages is through A Visual Guide to Layout Managers.


Note: 

This lesson covers writing layout code by hand, which can be challenging. 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.



Problems with the examples? Try Compiling and Running the Examples: FAQs.
Complaints? Compliments? Suggestions? Give us your feedback.

Previous page: How Layout Management Works
Next page: How to Use BorderLayout