Swing Layout

A layout manager determines the location and size of components placed into a container. Different layout manager classes use different algorithms for determining size and location.

Most of the Swing containers have special built-in layout managers. The exception is the JPanel class. It uses a Strategy design pattern allowing programmers to plug in the layout manager that best suits their purpose. The only layout manager methods that are normally used are constructors.