Many of these properties are specified in javadocs for specific classes. For example, BorderLayouts behavior is specified as:
The components are laid out in accordance with their preferred dimensions and container size restrictions. NORTH and SOUTH components can stretch horizontally; EAST and WEST components can stretch vertically; The CENTER component can be stretched both horizontally and vertically to fill the remaining space.
And FlowLayout indicates:
The flow layout allows each component to assume its natural (preferred) size.
GridLayout points out in the documentation for the constructor:
All components in the layout are of equal size. [However, a large grid]
And BoxLayout :
BoxLayout tries to organize the components according to their preferred width (for horizontal layout) or height (for vertical layout). For horizontal layout, if not all components are the same height, BoxLayout tries to make all the components as tall as the highest component. If this is not possible for a specific component, then BoxLayout will align this component vertically, in accordance with the alignment of the Y component. By default, the component has a Y alignment of 0.5, which means that the vertical center of the component must have the same Y coordinate as the vertical ones centers of other components with alignment of 0.5 Y.
Similarly, for a vertical layout, BoxLayout tries to make all the components in a column as wide as the widest component. If this fails, it aligns them horizontally according to their X alignments. For the PAGE_AXIS layout, horizontal alignment is based on the leading edge of the component. In other words, an alignment value of X 0.0 means the left edge of the component if the ComponentOrientation container is left to the right, otherwise it means the right edge of the component.
source share