Java Reference
In-Depth Information
components with the same horizontal alignment. Notice that instead of aligning to the left,
center, or right, the components grow to fill all available space.
Figure 10-13. Y-axis BoxLayout containers with the same vertical alignments and
unconstrained size
If the components had different alignments and an unconstrained maximum size, you
would get yet another behavior. Any component with an alignment not at the minimum (0.0f) or
maximum (1.0f) setting will grow to fill the entire space. If components with both the minimum
and maximum alignment settings are present, the middle edges of those two components will
align in the middle, as Figure 10-14 demonstrates.
Figure 10-14. Y-axis BoxLayout containers with different vertical alignments, unconstrained size,
and both minimum/maximum alignment present
If, however, only one component has an edge case (0.0 or 1.0) and is in a container with
components having other alignments, that edge-case component will grow toward somewhere
other than the middle of the container. This behavior is shown in Figure 10-15. The x-axis
BoxLayout containers work similarly with different horizontal alignments.
Search WWH ::




Custom Search