BorderLayout
BorderLayout is a layout manager used in Java AWT and Swing that arranges components into five regions: North, South, East, West, and Center. It is part of java.awt.BorderLayout and is commonly used as the default layout for containers such as a JFrame’s content pane. The layout responds to container resizing by adjusting the size of components in each region, with the Center region taking any remaining space after the others are laid out.
Each region has specific sizing behavior: North and South extend horizontally across the full width, preserving
Components are placed in a region by providing a constraint such as BorderLayout.NORTH when adding: container.setLayout(new
Because of its simplicity, BorderLayout is a common choice for top-level frames and panels that require a