Class FillPane

  • All Implemented Interfaces:
    java.lang.Iterable<Component>, Sequence<Component>, ConstrainedVisual, Visual

    public class FillPane
    extends Container
    Container that fills the space it has been given inside its parent and then arranges its child components in a line, either vertically or horizontally.

    This is useful, for instance, as a shortcut to making a one row and one column TablePane or GridPane. Adding just one child to a FillPane, such as a ScrollPane, will allow that child to fill the containing area (as opposed to using a BoxPane which will only size itself to the size of its children, which doesn't always work well with a ScrollPane).

    The n children of a FillPane will be given 1/n of the total space available, depending on the orientation. For vertical, each child's height will be 1/n of the total height, and for horizontal each child's width will be 1/n of the total width. The children will always stretch to the full width / height of the orthogonal direction.

    Here is an example: for a horizontal FillPane with three buttons as children:

     +--------------------------------------------------+
     |+---------------++--------------++---------------+|
     ||               ||              ||               ||
     ||               ||              ||               ||
     ||               ||              ||               ||
     ||   Button 1    ||   Button 2   ||   Button 3    ||
     ||               ||              ||               ||
     ||               ||              ||               ||
     ||               ||              ||               ||
     |+---------------++--------------++---------------+|
     +--------------------------------------------------+

    And here is a vertical FillPane with three Button children:

     +--------------------------------------------------+
     |+------------------------------------------------+|
     ||                                                ||
     ||                  Button 1                      ||
     ||                                                ||
     |+------------------------------------------------+|
     |+------------------------------------------------+|
     ||                                                ||
     ||                  Button 2                      ||
     ||                                                ||
     |+------------------------------------------------+|
     |+------------------------------------------------+|
     ||                                                ||
     ||                  Button 3                      ||
     ||                                                ||
     |+------------------------------------------------+|
     +--------------------------------------------------+