SlideShare a Scribd company logo
PRESENTATION

      ON


LAYOUT MANAGERS
INTRODUCTION
   Java uses Layout Managers to define the location
    and size of Graphical User Interface components.



   Java technology uses Layout Managers to define
    the location and size of Graphical User Interface
    components.. A Layout Manager implements a
    layout policy that defines constraints between
    components in a container.
TYPES OF LAYOUT MANAGER
Java technology provides the following Layout
Managers, each of which implements the Layout
Manager interface:

 Flow Layout
 Grid Layout

 Border Layout

 CardLayout
DEFAULT LAYOUT MANAGER


   The FlowLayout is the default Layout Manager for
    Panel, and hence the Applet class. The
    BorderLayout is the default Layout Manager for
    Window class and its subclasses (Frame and
    Dialog).
SETTING LAYOUT MANAGERS

   The following method defined in the Container class
    can be used for setting layout managers.



        void setLayout(LayoutManager mgr);
FLOWLAYOUT MANAGER


   FlowLayout places component in rows from left to
    right. Components towards the end of row are
    written on next row, if there is not enough space in
    the current row. The FlowLayout honors the
    specified size of a component.
CONTD….


   The following constructors of FlowLayout are
    provided by AWT –

        FlowLayout();
        FlowLayout(int alignment);
        FlowLayout(int alignment, int hor_gap, int
        ver_gap);
CONTD….
GRIDLAYOUT MANAGER

   A Grid Layout Manager places the components in a
    rectangular grid. Each component's position is
    identified by a column and row. All the cells in the
    grid have same size and width. Each component is
    stretched to the cell size. So a Grid Layout ignores
    the Component's preferred size.
CONTD….

The GridLayout class provides the following
constructors:



      GridLayout();
      GridLayout(int rows, int columns);
      GridLayout(int rows, int columns, int
      hor_gap, int ver_gap);
CONTD….
BORDERLAYOUT MANAGER


   A BorderLayout Manager divides the window into
    five regions - North, East, West, South and Center.
    A component can be explicitly added to one of the
    regions using the add() method of the Container
    class. Any space left over by the component in
    North, East, South and West is occupied by the
    component in Center.
CONTD:
   The BorderLayout class defines the following
    constructors :



        BorderLayout();
        BorderLayout(int hor_gap, int ver_gap);
CONTD…
CARD LAYOUT
   The CardLayout class is unique among the other
    layout managers in that it stores several different
    layouts. Each layout can be thought of as being on
    a separate index card in a deck that can be shuffled
    so that any card is on top at a given time.
CARD LAYOUT

CardLayout provides these two constructors:

 CardLayout( )
 CardLayout(int horz, int vert)
CONTD…
THANK YOU

More Related Content

PPT
Java layoutmanager
PPT
PPT
GUI Programming In Java
PPT
Graphical User Interface in JAVA
PDF
Java GUI PART II
PPTX
Gui in java
PPTX
GUI Programming in JAVA (Using Netbeans) - A Review
Java layoutmanager
GUI Programming In Java
Graphical User Interface in JAVA
Java GUI PART II
Gui in java
GUI Programming in JAVA (Using Netbeans) - A Review

What's hot (20)

PPTX
GUI Programming with Java
PPT
Awt controls ppt
PPT
Graphical User Interface (GUI) - 1
PPTX
Graphical User Interface (Gui)
PDF
JAVA GUI PART I
PPT
Java swing
PPT
Swing and Graphical User Interface in Java
PPTX
PDF
swingbasics
PDF
PPT
Java Swing JFC
PPT
java swing
PPT
Understanding layout managers
PPTX
java-Unit4 chap2- awt controls and layout managers of applet
PPSX
Dr. Rajeshree Khande :Introduction to Java AWT
PPTX
tL19 awt
PPTX
GUI programming
PDF
The AWT and Swing
PPTX
Java swing
GUI Programming with Java
Awt controls ppt
Graphical User Interface (GUI) - 1
Graphical User Interface (Gui)
JAVA GUI PART I
Java swing
Swing and Graphical User Interface in Java
swingbasics
Java Swing JFC
java swing
Understanding layout managers
java-Unit4 chap2- awt controls and layout managers of applet
Dr. Rajeshree Khande :Introduction to Java AWT
tL19 awt
GUI programming
The AWT and Swing
Java swing
Ad

Viewers also liked (20)

PPT
Java awt
PDF
Layouts - Java
PDF
Android ui layout
PDF
Java EE 01-Servlets and Containers
PPTX
Java Servlets
PDF
Java Thread Synchronization
PDF
Layouts in android
PPT
J2EE - JSP-Servlet- Container - Components
PDF
Java and DevOps: Supercharge Your Delivery Pipeline with Containers
ODP
Multithreading In Java
PPT
Java swing
PPT
Java Swing
PPT
Swing and AWT in java
PPT
Java: GUI
PDF
java swing tutorial for beginners(java programming tutorials)
PPT
java swing
PPTX
Image Encryption in java ppt.
PPSX
JDBC: java DataBase connectivity
PDF
Database Architecture and Basic Concepts
PPTX
Image encryption and decryption
Java awt
Layouts - Java
Android ui layout
Java EE 01-Servlets and Containers
Java Servlets
Java Thread Synchronization
Layouts in android
J2EE - JSP-Servlet- Container - Components
Java and DevOps: Supercharge Your Delivery Pipeline with Containers
Multithreading In Java
Java swing
Java Swing
Swing and AWT in java
Java: GUI
java swing tutorial for beginners(java programming tutorials)
java swing
Image Encryption in java ppt.
JDBC: java DataBase connectivity
Database Architecture and Basic Concepts
Image encryption and decryption
Ad

Similar to Java (20)

PDF
Module 2
PPT
Layout managementand event handling
DOCX
Java gives us layout managers whose responsibility it is to determine.docx
PPT
Java AWR LayoutManagers for B. Tech. 2nd Year.ppt
PPTX
HASHIR_PPT about java coding which is frontend section.pptx
PPT
24-BuildingGUIs Complete Materials in Java.ppt
PDF
Text Component FeaturesThe JTextComponent class is the foundation .pdf
PDF
8layout Managers
PDF
Java GUI Programming for beginners-graphics.pdf
PPTX
LayoutManager_Lec1.pptx
PPTX
AWT stands for Abstract Window Toolkit. AWT is collection of classes and int...
PDF
Lecture 16
PPTX
Java Graphics Programming
PPT
Java Graphics
PPT
Windows Programming with AWT
PDF
Ajp notes-chapter-01
PPTX
3_ppt_Layout.pptxgßbdbdbdbsbsbsbbsbsbsbsbsb
ODP
[C++ GUI Programming with Qt4] chap6
PPT
Unit4 AWT, Swings & Layouts power point presentation
PDF
A rendering architecture
Module 2
Layout managementand event handling
Java gives us layout managers whose responsibility it is to determine.docx
Java AWR LayoutManagers for B. Tech. 2nd Year.ppt
HASHIR_PPT about java coding which is frontend section.pptx
24-BuildingGUIs Complete Materials in Java.ppt
Text Component FeaturesThe JTextComponent class is the foundation .pdf
8layout Managers
Java GUI Programming for beginners-graphics.pdf
LayoutManager_Lec1.pptx
AWT stands for Abstract Window Toolkit. AWT is collection of classes and int...
Lecture 16
Java Graphics Programming
Java Graphics
Windows Programming with AWT
Ajp notes-chapter-01
3_ppt_Layout.pptxgßbdbdbdbsbsbsbbsbsbsbsbsb
[C++ GUI Programming with Qt4] chap6
Unit4 AWT, Swings & Layouts power point presentation
A rendering architecture

More from Anand Grewal (13)

PPT
distributed dbms
PPT
Transaction concurrency control
PPT
Object modeling
PPT
Object analysis and design
PPT
Object modeling
PPT
O ops concepts
PPT
System design
PPTX
Presentation12
PPTX
Presentation1
PPTX
Event handling
PPTX
PPTX
Pptemail
PPTX
Presentation on dns
distributed dbms
Transaction concurrency control
Object modeling
Object analysis and design
Object modeling
O ops concepts
System design
Presentation12
Presentation1
Event handling
Pptemail
Presentation on dns

Recently uploaded (20)

PDF
Practical Manual AGRO-233 Principles and Practices of Natural Farming
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PPTX
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
PDF
ChatGPT for Dummies - Pam Baker Ccesa007.pdf
PDF
Trump Administration's workforce development strategy
DOC
Soft-furnishing-By-Architect-A.F.M.Mohiuddin-Akhand.doc
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PDF
Paper A Mock Exam 9_ Attempt review.pdf.
PDF
What if we spent less time fighting change, and more time building what’s rig...
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PDF
A systematic review of self-coping strategies used by university students to ...
PPTX
UV-Visible spectroscopy..pptx UV-Visible Spectroscopy – Electronic Transition...
PDF
Chinmaya Tiranga quiz Grand Finale.pdf
PDF
Classroom Observation Tools for Teachers
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PDF
LNK 2025 (2).pdf MWEHEHEHEHEHEHEHEHEHEHE
PPTX
Radiologic_Anatomy_of_the_Brachial_plexus [final].pptx
PPTX
Cell Types and Its function , kingdom of life
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
LDMMIA Reiki Yoga Finals Review Spring Summer
Practical Manual AGRO-233 Principles and Practices of Natural Farming
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
ChatGPT for Dummies - Pam Baker Ccesa007.pdf
Trump Administration's workforce development strategy
Soft-furnishing-By-Architect-A.F.M.Mohiuddin-Akhand.doc
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
Paper A Mock Exam 9_ Attempt review.pdf.
What if we spent less time fighting change, and more time building what’s rig...
Supply Chain Operations Speaking Notes -ICLT Program
A systematic review of self-coping strategies used by university students to ...
UV-Visible spectroscopy..pptx UV-Visible Spectroscopy – Electronic Transition...
Chinmaya Tiranga quiz Grand Finale.pdf
Classroom Observation Tools for Teachers
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
LNK 2025 (2).pdf MWEHEHEHEHEHEHEHEHEHEHE
Radiologic_Anatomy_of_the_Brachial_plexus [final].pptx
Cell Types and Its function , kingdom of life
Microbial diseases, their pathogenesis and prophylaxis
LDMMIA Reiki Yoga Finals Review Spring Summer

Java

  • 1. PRESENTATION ON LAYOUT MANAGERS
  • 2. INTRODUCTION  Java uses Layout Managers to define the location and size of Graphical User Interface components.  Java technology uses Layout Managers to define the location and size of Graphical User Interface components.. A Layout Manager implements a layout policy that defines constraints between components in a container.
  • 3. TYPES OF LAYOUT MANAGER Java technology provides the following Layout Managers, each of which implements the Layout Manager interface:  Flow Layout  Grid Layout  Border Layout  CardLayout
  • 4. DEFAULT LAYOUT MANAGER  The FlowLayout is the default Layout Manager for Panel, and hence the Applet class. The BorderLayout is the default Layout Manager for Window class and its subclasses (Frame and Dialog).
  • 5. SETTING LAYOUT MANAGERS  The following method defined in the Container class can be used for setting layout managers. void setLayout(LayoutManager mgr);
  • 6. FLOWLAYOUT MANAGER  FlowLayout places component in rows from left to right. Components towards the end of row are written on next row, if there is not enough space in the current row. The FlowLayout honors the specified size of a component.
  • 7. CONTD….  The following constructors of FlowLayout are provided by AWT – FlowLayout(); FlowLayout(int alignment); FlowLayout(int alignment, int hor_gap, int ver_gap);
  • 9. GRIDLAYOUT MANAGER  A Grid Layout Manager places the components in a rectangular grid. Each component's position is identified by a column and row. All the cells in the grid have same size and width. Each component is stretched to the cell size. So a Grid Layout ignores the Component's preferred size.
  • 10. CONTD…. The GridLayout class provides the following constructors: GridLayout(); GridLayout(int rows, int columns); GridLayout(int rows, int columns, int hor_gap, int ver_gap);
  • 12. BORDERLAYOUT MANAGER  A BorderLayout Manager divides the window into five regions - North, East, West, South and Center. A component can be explicitly added to one of the regions using the add() method of the Container class. Any space left over by the component in North, East, South and West is occupied by the component in Center.
  • 13. CONTD:  The BorderLayout class defines the following constructors : BorderLayout(); BorderLayout(int hor_gap, int ver_gap);
  • 15. CARD LAYOUT  The CardLayout class is unique among the other layout managers in that it stores several different layouts. Each layout can be thought of as being on a separate index card in a deck that can be shuffled so that any card is on top at a given time.
  • 16. CARD LAYOUT CardLayout provides these two constructors:  CardLayout( )  CardLayout(int horz, int vert)