SlideShare une entreprise Scribd logo
1  sur  18
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

Contenu connexe

Tendances

Graphical User Interface (GUI) - 1
Graphical User Interface (GUI) - 1Graphical User Interface (GUI) - 1
Graphical User Interface (GUI) - 1
PRN USM
 

Tendances (20)

GUI Programming with Java
GUI Programming with JavaGUI Programming with Java
GUI Programming with Java
 
Awt controls ppt
Awt controls pptAwt controls ppt
Awt controls ppt
 
Graphical User Interface (GUI) - 1
Graphical User Interface (GUI) - 1Graphical User Interface (GUI) - 1
Graphical User Interface (GUI) - 1
 
Graphical User Interface (Gui)
Graphical User Interface (Gui)Graphical User Interface (Gui)
Graphical User Interface (Gui)
 
JAVA GUI PART I
JAVA GUI PART IJAVA GUI PART I
JAVA GUI PART I
 
Swing
SwingSwing
Swing
 
Java swing
Java swingJava swing
Java swing
 
Swing and Graphical User Interface in Java
Swing and Graphical User Interface in JavaSwing and Graphical User Interface in Java
Swing and Graphical User Interface in Java
 
Awt
AwtAwt
Awt
 
swingbasics
swingbasicsswingbasics
swingbasics
 
Gui
GuiGui
Gui
 
Java Swing JFC
Java Swing JFCJava Swing JFC
Java Swing JFC
 
java swing
java swingjava swing
java swing
 
Understanding layout managers
Understanding layout managersUnderstanding layout managers
Understanding layout managers
 
java-Unit4 chap2- awt controls and layout managers of applet
java-Unit4 chap2- awt controls and layout managers of appletjava-Unit4 chap2- awt controls and layout managers of applet
java-Unit4 chap2- awt controls and layout managers of applet
 
Dr. Rajeshree Khande :Introduction to Java AWT
Dr. Rajeshree Khande :Introduction to Java AWTDr. Rajeshree Khande :Introduction to Java AWT
Dr. Rajeshree Khande :Introduction to Java AWT
 
tL19 awt
tL19 awttL19 awt
tL19 awt
 
GUI programming
GUI programmingGUI programming
GUI programming
 
The AWT and Swing
The AWT and SwingThe AWT and Swing
The AWT and Swing
 
Java swing
Java swingJava swing
Java swing
 

En vedette

Layouts - Java
Layouts - JavaLayouts - Java
Layouts - Java
njca01
 
Android ui layout
Android ui layoutAndroid ui layout
Android ui layout
Krazy Koder
 
Java Thread Synchronization
Java Thread SynchronizationJava Thread Synchronization
Java Thread Synchronization
Benj Del Mundo
 
Multithreading In Java
Multithreading In JavaMultithreading In Java
Multithreading In Java
parag
 
Database Architecture and Basic Concepts
Database Architecture and Basic ConceptsDatabase Architecture and Basic Concepts
Database Architecture and Basic Concepts
Tony Wong
 

En vedette (20)

Java awt
Java awtJava awt
Java awt
 
Layouts - Java
Layouts - JavaLayouts - Java
Layouts - Java
 
Android ui layout
Android ui layoutAndroid ui layout
Android ui layout
 
Java EE 01-Servlets and Containers
Java EE 01-Servlets and ContainersJava EE 01-Servlets and Containers
Java EE 01-Servlets and Containers
 
Java Servlets
Java ServletsJava Servlets
Java Servlets
 
Java Thread Synchronization
Java Thread SynchronizationJava Thread Synchronization
Java Thread Synchronization
 
Layouts in android
Layouts in androidLayouts in android
Layouts in android
 
J2EE - JSP-Servlet- Container - Components
J2EE - JSP-Servlet- Container - ComponentsJ2EE - JSP-Servlet- Container - Components
J2EE - JSP-Servlet- Container - Components
 
Java and DevOps: Supercharge Your Delivery Pipeline with Containers
Java and DevOps: Supercharge Your Delivery Pipeline with ContainersJava and DevOps: Supercharge Your Delivery Pipeline with Containers
Java and DevOps: Supercharge Your Delivery Pipeline with Containers
 
Multithreading In Java
Multithreading In JavaMultithreading In Java
Multithreading In Java
 
Java swing
Java swingJava swing
Java swing
 
Java Swing
Java SwingJava Swing
Java Swing
 
Swing and AWT in java
Swing and AWT in javaSwing and AWT in java
Swing and AWT in java
 
Java: GUI
Java: GUIJava: GUI
Java: GUI
 
java swing tutorial for beginners(java programming tutorials)
java swing tutorial for beginners(java programming tutorials)java swing tutorial for beginners(java programming tutorials)
java swing tutorial for beginners(java programming tutorials)
 
java swing
java swingjava swing
java swing
 
Image Encryption in java ppt.
Image Encryption in java ppt.Image Encryption in java ppt.
Image Encryption in java ppt.
 
JDBC: java DataBase connectivity
JDBC: java DataBase connectivityJDBC: java DataBase connectivity
JDBC: java DataBase connectivity
 
Database Architecture and Basic Concepts
Database Architecture and Basic ConceptsDatabase Architecture and Basic Concepts
Database Architecture and Basic Concepts
 
Image encryption and decryption
Image encryption and decryptionImage encryption and decryption
Image encryption and decryption
 

Similaire à Java

java-layoutmanager-151027135512-lva1-app6892.pdf
java-layoutmanager-151027135512-lva1-app6892.pdfjava-layoutmanager-151027135512-lva1-app6892.pdf
java-layoutmanager-151027135512-lva1-app6892.pdf
ssuserec53e73
 
Layout managementand event handling
Layout managementand event handlingLayout managementand event handling
Layout managementand event handling
Charli Patel
 
Java gives us layout managers whose responsibility it is to determine.docx
Java gives us layout managers whose responsibility it is to determine.docxJava gives us layout managers whose responsibility it is to determine.docx
Java gives us layout managers whose responsibility it is to determine.docx
olsenlinnea427
 
Text Component FeaturesThe JTextComponent class is the foundation .pdf
Text Component FeaturesThe JTextComponent class is the foundation .pdfText Component FeaturesThe JTextComponent class is the foundation .pdf
Text Component FeaturesThe JTextComponent class is the foundation .pdf
aquadreammail
 
8layout Managers
8layout Managers8layout Managers
8layout Managers
Adil Jafri
 
Windows Programming with AWT
Windows Programming with AWTWindows Programming with AWT
Windows Programming with AWT
backdoor
 

Similaire à Java (20)

java-layoutmanager-151027135512-lva1-app6892.pdf
java-layoutmanager-151027135512-lva1-app6892.pdfjava-layoutmanager-151027135512-lva1-app6892.pdf
java-layoutmanager-151027135512-lva1-app6892.pdf
 
Module 2
Module 2Module 2
Module 2
 
Layout managementand event handling
Layout managementand event handlingLayout managementand event handling
Layout managementand event handling
 
Java gives us layout managers whose responsibility it is to determine.docx
Java gives us layout managers whose responsibility it is to determine.docxJava gives us layout managers whose responsibility it is to determine.docx
Java gives us layout managers whose responsibility it is to determine.docx
 
Text Component FeaturesThe JTextComponent class is the foundation .pdf
Text Component FeaturesThe JTextComponent class is the foundation .pdfText Component FeaturesThe JTextComponent class is the foundation .pdf
Text Component FeaturesThe JTextComponent class is the foundation .pdf
 
8layout Managers
8layout Managers8layout Managers
8layout Managers
 
Java GUI Programming for beginners-graphics.pdf
Java GUI Programming for beginners-graphics.pdfJava GUI Programming for beginners-graphics.pdf
Java GUI Programming for beginners-graphics.pdf
 
LayoutManager_Lec1.pptx
LayoutManager_Lec1.pptxLayoutManager_Lec1.pptx
LayoutManager_Lec1.pptx
 
Lecture 16
Lecture 16Lecture 16
Lecture 16
 
Java Graphics Programming
Java Graphics ProgrammingJava Graphics Programming
Java Graphics Programming
 
Java Graphics
Java GraphicsJava Graphics
Java Graphics
 
Windows Programming with AWT
Windows Programming with AWTWindows Programming with AWT
Windows Programming with AWT
 
Ajp notes-chapter-01
Ajp notes-chapter-01Ajp notes-chapter-01
Ajp notes-chapter-01
 
3_ppt_Layout.pptxgßbdbdbdbsbsbsbbsbsbsbsbsb
3_ppt_Layout.pptxgßbdbdbdbsbsbsbbsbsbsbsbsb3_ppt_Layout.pptxgßbdbdbdbsbsbsbbsbsbsbsbsb
3_ppt_Layout.pptxgßbdbdbdbsbsbsbbsbsbsbsbsb
 
[C++ GUI Programming with Qt4] chap6
[C++ GUI Programming with Qt4] chap6[C++ GUI Programming with Qt4] chap6
[C++ GUI Programming with Qt4] chap6
 
A rendering architecture
A rendering architectureA rendering architecture
A rendering architecture
 
Abstract Window Toolkit
Abstract Window ToolkitAbstract Window Toolkit
Abstract Window Toolkit
 
Advanced Java programming
Advanced Java programmingAdvanced Java programming
Advanced Java programming
 
Ajp notes-chapter-01
Ajp notes-chapter-01Ajp notes-chapter-01
Ajp notes-chapter-01
 
UNIT-2-AJAVA.pdf
UNIT-2-AJAVA.pdfUNIT-2-AJAVA.pdf
UNIT-2-AJAVA.pdf
 

Plus de Anand Grewal

Plus de Anand Grewal (13)

distributed dbms
distributed dbmsdistributed dbms
distributed dbms
 
Transaction concurrency control
Transaction concurrency controlTransaction concurrency control
Transaction concurrency control
 
Object modeling
Object modelingObject modeling
Object modeling
 
Object analysis and design
Object analysis and designObject analysis and design
Object analysis and design
 
Object modeling
Object modelingObject modeling
Object modeling
 
O ops concepts
O ops conceptsO ops concepts
O ops concepts
 
System design
System designSystem design
System design
 
Presentation12
Presentation12Presentation12
Presentation12
 
Presentation1
Presentation1Presentation1
Presentation1
 
Event handling
Event handlingEvent handling
Event handling
 
Isp
IspIsp
Isp
 
Pptemail
PptemailPptemail
Pptemail
 
Presentation on dns
Presentation on dnsPresentation on dns
Presentation on dns
 

Dernier

Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 
Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch Letter
MateoGardella
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
PECB
 
Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.
MateoGardella
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 

Dernier (20)

Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch Letter
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 

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)