12 Layout Managers

7
LAYOUT MANAGERS Object Oriented Programming

description

OOP

Transcript of 12 Layout Managers

  • LAYOUT MANAGERS Object Oriented Programming

    Advanced Object-Oriented Concepts (Part 1)

  • Kinds of Layout ManagersCardLayoutUse when you need to add components that are displayed one at a timeBoxLayoutUse when you need to add components into a single row or a single columnGridBagLayoutUse when you need to set size, placement, and alignment constraints for every component that you add

    Events and Event Handling*

    Advanced Object-Oriented Concepts (Part 1)

  • Kinds of Layout ManagersBorderLayoutUse when you add components to a maximum of five sections arranged in north, south, east, west, and center positionsFlowLayoutUse when you need to add components from left to right; automatically moves to the next row when needed, and each component is the same sizeGridLayoutUse when you need to add components into a grid of rows and columns; each component is the same size

    Events and Event Handling*

    Advanced Object-Oriented Concepts (Part 1)

  • Border LayoutIt divides a rectangular screen aarea into five regionsa central region surrounded by four border regions. Events and Event Handling*

    Advanced Object-Oriented Concepts (Part 1)

  • FlowLayoutFlowLayout manager class provides a simple layout manager that is used, by default, by the JPanel objects. It sizes each component according to its preferred size and arranges them in horizontal wrapping lines so that they are evenly spaced. Events and Event Handling*

    Advanced Object-Oriented Concepts (Part 1)

  • GridLayoutEvents and Event Handling*

    Advanced Object-Oriented Concepts (Part 1)

  • CardLayoutThe CardLayout manager generates a stack of containers or components, one on top of another. The CardLayout is used when you want multiple components to share the same display space.

    Events and Event Handling*

    Advanced Object-Oriented Concepts (Part 1)

    *