Layout


  • Components are grouped together in containers.
  • Different layout managers are possible for each container:
    BorderLayout- NSEW layout
    FlowLayout- left-to-right with overflow
    GridLayout- regular rectangular grid
    GridBagLayout- general gridded layout
    CardLayout- allows "flipping" through a set of "cards"
    Goto Example (JDK1.1 required)
Example for a GridBagLayout. Each component gets constraints which define the grid width and height, the position and if it will resize.

Java Tutorial - Standard Classes Jens Trapp, 1997