Layout Managers
Home Up Layout Managers Standard Graphics Images Event Handling UI Components

 

Border
Card
Flow
Grid
Null

There are several available layout managers in Java.  The purpose of a layout manager is to control how various components are displayed on the screen.  There are six built-in, layout managers.  It is recommended that you learn them in the following order:

  1. Flow layout manager.  With this layout manager, components are added to the window from left to right and from top to bottom.
  2. Border layout manager.  This layout manager provides  "North", "South", "East", "West", and "Central" areas to utilize.
  3. Grid layout manager.  With this layout manager, the window is divided up into a two dimensional grid.  Components are then placed into cells within the grid.
  4. Null layout manager.  The null layout manager gives the programmer complete power over choosing where and how big the individual components on the screen should be.   This author finds the null manager to be the most useful when it comes to producing professional looking windows that look good on multiple platforms.
  5. Card layout manager.  With this layout manager, the programmer defines what a series of cards should look like.  The card layout manager allows one of these "cards" to be displayed at a time. 
  6. GridBag layout manager.  This layout manager is not covered in this tutorial.   It is powerful, but difficult to use.  This author thinks that the null layout manager is a superior alternative to the gridbag layout manager.