The {@code HVLayout package} lays out components Horizontal and Vertical in a Java Swing GUI and shrinks or grows the components when needed according to the components Minimum-, Preferred- and Maximum-sizes. The containers {@code HLayout} and {@code VLayout} do the calculations for the correct sizes of the components for the horizontal and vertical sizes respectively. The container-components {@code HBox} and {@code VBox} allow components to be added at a specified index (method add(Component, int)) and can themselves be placed inside a scroller. The boxes can also be nested (one box can contain one or more other boxes).
If you can break a window down in vertically and horizontally aligned components, then you can use this layout manager.

Vertically aligned components can be aligned normal (e.g. left to right), centered (in the middle) and opposite the reading direction (e.g. right to left).

The class {@code HVProps} contains helper-methods that are required to use on the components that are layed out. The methods in {@code HVProps} take the current font-size into account. {@code FormUI} is a class that uses the helper-methods from {@code HVProps} to return components with proper sizes. {@code TestUI} uses {@code FormUI} and shows what it looks like.

Run {@code TestUI} to see in what kind of screen behaviour and layout the use of {@code FormUI} results in. See how the screen adapts to a new font-size by clicking "Switch big font". {@code HBox} supports systems with left-to-right and right-to-left reading, use the checkbox "Switch orientation" for a demontration. See {@code nl.fwiers.util.FontSelector} for another example.

Run {@code AddressBookDemo} to see a cleaner manner in which the {@code HVLayout} package can be used ({@code AddressBookDemo} does not use {@code FormUI, HBox and VBox}, just {@code HVProps, VLayout and HLayout}).

You can use this package "as is" as is done by {@code TestUI} which uses {@code FormUI} extensively. But as {@code AddressBookDemo} shows, it is relatively easy to define your own behavior for a form ({@code AddressBookDemo} does not use {@code FormUI}). E.g. {@code AddressBookDemo} uses buttons that shrink, but {@code FormUI} does not have a function for that (because, in my opinion, buttons should not shrink).
Make your own {@code FormUI} when you feel the need for it. {@code FormUI} is likely to change (unlike the other classes in this package). Copy what you like from {@code FormUI} and adjust to your own needs.