Class Layouts


  • public final class Layouts
    extends Object
    A utility class for layouts.
    • Method Detail

      • borderLayout

        public static BorderLayout borderLayout()
        Creates a BorderLayout using the default vertical and horizontal gap value
        Returns:
        a BorderLayout
        See Also:
        HORIZONTAL_VERTICAL_GAP
      • flowLayout

        public static FlowLayout flowLayout​(int alignment)
        Creates a FlowLayout using the default vertical and horizontal gap value
        Parameters:
        alignment - the alignment
        Returns:
        a FlowLayout
        See Also:
        HORIZONTAL_VERTICAL_GAP
      • gridLayout

        public static GridLayout gridLayout​(int rows,
                                            int columns)
        Creates a GridLayout using the default vertical and horizontal gap value
        Parameters:
        rows - the number of rows
        columns - the number of columns
        Returns:
        a GridLayout
        See Also:
        HORIZONTAL_VERTICAL_GAP
      • flexibleGridLayout

        public static FlexibleGridLayout flexibleGridLayout​(int rows,
                                                            int columns,
                                                            boolean fixRowHeights,
                                                            boolean fixColumnWidths)
        Creates a FlexibleGridLayout using the default vertical and horizontal gap value
        Parameters:
        rows - the number of rows
        columns - the number of columns
        fixRowHeights - if true then the height of the rows is fixed as the largest value
        fixColumnWidths - if true then the width of the columns is fixed as the largest value
        Returns:
        a FlexibleGridLayout
        See Also:
        HORIZONTAL_VERTICAL_GAP