Class Panels


  • public final class Panels
    extends Object
    Utility class for creating some basic panels.
    • Method Detail

      • createNorthCenterPanel

        public static JPanel createNorthCenterPanel​(JComponent northComponent,
                                                    JComponent centerComponent)
        Creates a JPanel, using a BorderLayout, adding the given components to their respective positions.
        Parameters:
        northComponent - the component to display in the BorderLayout.NORTH position
        centerComponent - the component to display in the BorderLayout.CENTER position
        Returns:
        a panel displaying the given components in the NORTH an CENTER positions in a BorderLayout
      • createWestCenterPanel

        public static JPanel createWestCenterPanel​(JComponent westComponent,
                                                   JComponent centerComponent)
        Creates a JPanel, using a BorderLayout, adding the given components to their respective positions.
        Parameters:
        westComponent - the component to display in the BorderLayout.WEST position
        centerComponent - the component to display in the BorderLayout.CENTER position
        Returns:
        a panel displaying the given components in the WEST an CENTER positions in a BorderLayout
      • createEastButtonPanel

        public static JPanel createEastButtonPanel​(JComponent centerComponent,
                                                   Action buttonAction)
        Creates a panel with centerComponent in the BorderLayout.CENTER position and a non-focusable button based on buttonAction in the BorderLayout.EAST position, with the buttons preferred size based on the preferred height of centerComponent.
        Parameters:
        centerComponent - the center component
        buttonAction - the button action
        Returns:
        a panel
        See Also:
        createEastFocusableButtonPanel(JComponent, Action)
      • createEastFocusableButtonPanel

        public static JPanel createEastFocusableButtonPanel​(JComponent centerComponent,
                                                            Action buttonAction)
        Creates a panel with centerComponent in the BorderLayout.CENTER position and a focusable button based on buttonAction in the BorderLayout.EAST position, with the buttons preferred size based on the preferred height of centerComponent.
        Parameters:
        centerComponent - the center component
        buttonAction - the button action
        Returns:
        a panel