Layout manager : FlowLayout « Swing « Java Tutorial

That layout manager is responsible for positioning components, regardless of the platform or screen size.

To find out how much space a component needs, the layout manager calls the component's getMinimumSize(), getPreferredSize(), and getMaximumSize() methods.

The AWT layout managers are

  1. FlowLayout,
  2. BorderLayout,
  3. GridLayout,
  4. CardLayout, and
  5. GridBagLayout.

The Swing layouts are

  1. BoxLayout,
  2. OverlayLayout,
  3. ScrollPaneLayout,
  4. ViewportLayout, and
  5. SpringLayout.

14.89.1.Laying Out Components in a Flow (Left-to-Right, Top-to-Bottom)
14.89.2.Three constructors available for the FlowLayout manager.
14.89.3.Layout manager
14.89.4.FlowLayout: the default layout manager for a JPanel.
14.89.5.FlowLayout BehaviorFlowLayout Behavior
14.89.6.Using FlowLayoutUsing FlowLayout
14.89.7.Changing the GapChanging the Gap
14.89.8.Setting the gaps between components and rows explicitly by calling the setHgap()Setting the gaps between components and rows explicitly by calling the setHgap()
14.89.9.Demonstrates how to fix common alignment problemsDemonstrates how to fix common alignment problems
14.89.10.Use FlowLayout to hold checkBox, Label and TextField