SlideShare a Scribd company logo
1 of 12
Layout ManagerLayout Manager
Arranges the layout of window containing diffArranges the layout of window containing diff
controls.controls.
Default is the flow LayoutDefault is the flow Layout
setLayout() :setLayout() :
void setLayout(Layout Managervoid setLayout(Layout Manager
lyoutObj)lyoutObj)
Disable layout by passingDisable layout by passing nullnull for objectfor object
Component can be manually placed byComponent can be manually placed by
usingusing setBounds()setBounds()
minimumLayoutSize()minimumLayoutSize()
preferredLayoutSize()preferredLayoutSize()
Types of Layout ManagerTypes of Layout Manager
1. FlowLayout1. FlowLayout
2.BorderLayout2.BorderLayout
3. GridLayout3. GridLayout
4. CardLayout4. CardLayout
5. GridbagLayout5. GridbagLayout
FlowLayoutFlowLayout
 It is default flowlayoutIt is default flowlayout
 Implements simple layout styleImplements simple layout style
 Constructor are-Constructor are-
- FlowLayout()FlowLayout()
- FlowLayout(int how)FlowLayout(int how)
- FlowLayout(int how, int horz, int vert )FlowLayout(int how, int horz, int vert )
 Valid values for how-Valid values for how-
 FlowLayout.LEFTFlowLayout.LEFT
 FlowLayout.RIGHTFlowLayout.RIGHT
 FlowLayout.CENTERFlowLayout.CENTER
BorderLayoutBorderLayout
 The border layout has four narrow, fixed-The border layout has four narrow, fixed-
width components at the edges & 1 largewidth components at the edges & 1 large
area in the centerarea in the center
 Constructor of BorderLayout are-Constructor of BorderLayout are-
-BorderLayout()-BorderLayout()
-BorderLayout(int horz, int vert)-BorderLayout(int horz, int vert)
 Component can be used with add() methodComponent can be used with add() method
Void add(component compobj, ObjectVoid add(component compobj, Object
region)region)
BorderLayoutBorderLayout
 BorderLayout Defines certain regionBorderLayout Defines certain region
-BorderLayout.CENTER-BorderLayout.CENTER
-BorderLayout.SOUTH-BorderLayout.SOUTH
-BorderLayout.EAST-BorderLayout.EAST
-BorderLayout.WEST-BorderLayout.WEST
-BorderLayoutNORTH-BorderLayoutNORTH
GridLayoutGridLayout
 Used to layout Component in twoUsed to layout Component in two
dimensional griddimensional grid
 Need to define no. of rows & col.Need to define no. of rows & col.
 Constructors are-Constructors are-
--GridLayout ()GridLayout ()
- GridLayout(int noRows, int noCols)GridLayout(int noRows, int noCols)
- GridLayout(int noRows, int noCols, int horz, int vert)GridLayout(int noRows, int noCols, int horz, int vert)
CardLayoutCardLayout
 The CardLayout class manages the components inThe CardLayout class manages the components in
such a manner that only one component is visible atsuch a manner that only one component is visible at
a time. It treats each component as a card that isa time. It treats each component as a card that is
why it is known as CardLayout.why it is known as CardLayout.
 Constructor are-Constructor are-
 CardLayout( )CardLayout( )
 CardLayout(intCardLayout(int horz, int vert)horz, int vert)
 use this form of add( ) when adding cards to a paneluse this form of add( ) when adding cards to a panel
 void add(Componentvoid add(Component panelObj, Object name)panelObj, Object name)
CardLayoutCardLayout
Methods defined byMethods defined by CardLayoutCardLayout
 void first(Containervoid first(Container deck)deck)
 void last(Containervoid last(Container deck)deck)
 void next(Containervoid next(Container deck)deck)
 void previous(Containervoid previous(Container deck)deck)
 void show(Containervoid show(Container deck, String cardName)deck, String cardName)
GridbagLayoutGridbagLayout
 The class GridBagLayout arranges components inThe class GridBagLayout arranges components in
a horizontal and vertical manner Implements simplea horizontal and vertical manner Implements simple
layout stylelayout style
 each GridBagLayout object maintains a dynamic,each GridBagLayout object maintains a dynamic,
rectangular grid of cells, with each componentrectangular grid of cells, with each component
occupying one or more cellsoccupying one or more cells
 Constructor are-Constructor are-
 GridBagLayout()GridBagLayout()
 Method used to set constraintsMethod used to set constraints
-void setContsraints(Component-void setContsraints(Component
comp,Gridbagconstraints cns)comp,Gridbagconstraints cns)
GridbagLayoutGridbagLayout
Absolute ValuesAbsolute Values
 GridBagConstraints.NORTHGridBagConstraints.NORTH
GridBagConstraints.SOUTHGridBagConstraints.SOUTH
GridBagConstraints.WESTGridBagConstraints.WEST
GridBagConstraints.EASTGridBagConstraints.EAST
GridBagConstraints.NORTHWESTGridBagConstraints.NORTHWEST
GridBagConstraints.NORTHEASTGridBagConstraints.NORTHEAST
GridBagConstraints.SOUTHWESTGridBagConstraints.SOUTHWEST
GridBagConstraints.SOUTHEASTGridBagConstraints.SOUTHEAST
GridBagConstraints.CENTER (the default)GridBagConstraints.CENTER (the default)
GridbagLayoutGridbagLayout
Orientation Relative ValuesOrientation Relative Values
 GridBagConstraints.PAGE_STARTGridBagConstraints.PAGE_START
GridBagConstraints.PAGE_ENDGridBagConstraints.PAGE_END
GridBagConstraints.LINE_STARTGridBagConstraints.LINE_START
GridBagConstraints.LINE_ENDGridBagConstraints.LINE_END
GridBagConstraints.FIRST_LINE_STARTGridBagConstraints.FIRST_LINE_START
GridBagConstraints.FIRST_LINE_ENDGridBagConstraints.FIRST_LINE_END
GridBagConstraints.LAST_LINE_STARTGridBagConstraints.LAST_LINE_START
GridBagConstraints.LAST_LINE_ENDGridBagConstraints.LAST_LINE_END
GridbagLayoutGridbagLayout
Baseline Relative ValuesBaseline Relative Values
 GridBagConstraints.BASELINEGridBagConstraints.BASELINE
GridBagConstraints.BASELINE_LEADINGGridBagConstraints.BASELINE_LEADING
GridBagConstraints.BASELINE_TRAILINGGridBagConstraints.BASELINE_TRAILING
GridBagConstraints.ABOVE_BASELINEGridBagConstraints.ABOVE_BASELINE
GridBagConstraints.ABOVE_BASELINE_LEADINGGridBagConstraints.ABOVE_BASELINE_LEADING
GridBagConstraints.ABOVE_BASELINE_TRAILINGGridBagConstraints.ABOVE_BASELINE_TRAILING
GridBagConstraints.BELOW_BASELINEGridBagConstraints.BELOW_BASELINE
GridBagConstraints.BELOW_BASELINE_LEADINGGridBagConstraints.BELOW_BASELINE_LEADING
GridBagConstraints.BELOW_BASELINE_TRAILINGGridBagConstraints.BELOW_BASELINE_TRAILING

More Related Content

Similar to Javalayout

Understanding layout managers
Understanding layout managersUnderstanding layout managers
Understanding layout managersNuha Noor
 
java-layoutmanager-151027135512-lva1-app6892.pdf
java-layoutmanager-151027135512-lva1-app6892.pdfjava-layoutmanager-151027135512-lva1-app6892.pdf
java-layoutmanager-151027135512-lva1-app6892.pdfssuserec53e73
 
3_ppt_Layout.pptxgßbdbdbdbsbsbsbbsbsbsbsbsb
3_ppt_Layout.pptxgßbdbdbdbsbsbsbbsbsbsbsbsb3_ppt_Layout.pptxgßbdbdbdbsbsbsbbsbsbsbsbsb
3_ppt_Layout.pptxgßbdbdbdbsbsbsbbsbsbsbsbsbabhishekmathuroffici
 
Layout managementand event handling
Layout managementand event handlingLayout managementand event handling
Layout managementand event handlingCharli Patel
 
Unit-1 awt advanced java programming
Unit-1 awt advanced java programmingUnit-1 awt advanced java programming
Unit-1 awt advanced java programmingAmol Gaikwad
 
Windows Programming with AWT
Windows Programming with AWTWindows Programming with AWT
Windows Programming with AWTbackdoor
 
Java Graphics
Java GraphicsJava Graphics
Java GraphicsShraddha
 
[C++ GUI Programming with Qt4] chap6
[C++ GUI Programming with Qt4] chap6[C++ GUI Programming with Qt4] chap6
[C++ GUI Programming with Qt4] chap6Picker Weng
 
GUI Programming In Java
GUI Programming In JavaGUI Programming In Java
GUI Programming In Javayht4ever
 
Abstract Window Toolkit
Abstract Window ToolkitAbstract Window Toolkit
Abstract Window ToolkitRutvaThakkar1
 

Similar to Javalayout (20)

Module 2
Module 2Module 2
Module 2
 
Understanding layout managers
Understanding layout managersUnderstanding layout managers
Understanding layout managers
 
java-layoutmanager-151027135512-lva1-app6892.pdf
java-layoutmanager-151027135512-lva1-app6892.pdfjava-layoutmanager-151027135512-lva1-app6892.pdf
java-layoutmanager-151027135512-lva1-app6892.pdf
 
3_ppt_Layout.pptxgßbdbdbdbsbsbsbbsbsbsbsbsb
3_ppt_Layout.pptxgßbdbdbdbsbsbsbbsbsbsbsbsb3_ppt_Layout.pptxgßbdbdbdbsbsbsbbsbsbsbsbsb
3_ppt_Layout.pptxgßbdbdbdbsbsbsbbsbsbsbsbsb
 
Layout managementand event handling
Layout managementand event handlingLayout managementand event handling
Layout managementand event handling
 
java swing
java swingjava swing
java swing
 
Java swing
Java swingJava swing
Java swing
 
Unit-1 awt advanced java programming
Unit-1 awt advanced java programmingUnit-1 awt advanced java programming
Unit-1 awt advanced java programming
 
Windows Programming with AWT
Windows Programming with AWTWindows Programming with AWT
Windows Programming with AWT
 
Swing
SwingSwing
Swing
 
Lecture 16
Lecture 16Lecture 16
Lecture 16
 
swingbasics
swingbasicsswingbasics
swingbasics
 
Java Graphics
Java GraphicsJava Graphics
Java Graphics
 
17625-1.pptx
17625-1.pptx17625-1.pptx
17625-1.pptx
 
[C++ GUI Programming with Qt4] chap6
[C++ GUI Programming with Qt4] chap6[C++ GUI Programming with Qt4] chap6
[C++ GUI Programming with Qt4] chap6
 
Ingles 2do parcial
Ingles   2do parcialIngles   2do parcial
Ingles 2do parcial
 
LayoutManager_Lec1.pptx
LayoutManager_Lec1.pptxLayoutManager_Lec1.pptx
LayoutManager_Lec1.pptx
 
GUI Programming In Java
GUI Programming In JavaGUI Programming In Java
GUI Programming In Java
 
Chap1 1 4
Chap1 1 4Chap1 1 4
Chap1 1 4
 
Abstract Window Toolkit
Abstract Window ToolkitAbstract Window Toolkit
Abstract Window Toolkit
 

Recently uploaded

Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineeringmalavadedarshan25
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxDeepakSakkari2
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)Suman Mia
 
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...RajaP95
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
Analog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAnalog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAbhinavSharma374939
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLDeelipZope
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝soniya singh
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 

Recently uploaded (20)

Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineering
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptx
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
 
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
Analog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAnalog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog Converter
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCL
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 

Javalayout

  • 1. Layout ManagerLayout Manager Arranges the layout of window containing diffArranges the layout of window containing diff controls.controls. Default is the flow LayoutDefault is the flow Layout setLayout() :setLayout() : void setLayout(Layout Managervoid setLayout(Layout Manager lyoutObj)lyoutObj) Disable layout by passingDisable layout by passing nullnull for objectfor object Component can be manually placed byComponent can be manually placed by usingusing setBounds()setBounds() minimumLayoutSize()minimumLayoutSize() preferredLayoutSize()preferredLayoutSize()
  • 2. Types of Layout ManagerTypes of Layout Manager 1. FlowLayout1. FlowLayout 2.BorderLayout2.BorderLayout 3. GridLayout3. GridLayout 4. CardLayout4. CardLayout 5. GridbagLayout5. GridbagLayout
  • 3. FlowLayoutFlowLayout  It is default flowlayoutIt is default flowlayout  Implements simple layout styleImplements simple layout style  Constructor are-Constructor are- - FlowLayout()FlowLayout() - FlowLayout(int how)FlowLayout(int how) - FlowLayout(int how, int horz, int vert )FlowLayout(int how, int horz, int vert )  Valid values for how-Valid values for how-  FlowLayout.LEFTFlowLayout.LEFT  FlowLayout.RIGHTFlowLayout.RIGHT  FlowLayout.CENTERFlowLayout.CENTER
  • 4. BorderLayoutBorderLayout  The border layout has four narrow, fixed-The border layout has four narrow, fixed- width components at the edges & 1 largewidth components at the edges & 1 large area in the centerarea in the center  Constructor of BorderLayout are-Constructor of BorderLayout are- -BorderLayout()-BorderLayout() -BorderLayout(int horz, int vert)-BorderLayout(int horz, int vert)  Component can be used with add() methodComponent can be used with add() method Void add(component compobj, ObjectVoid add(component compobj, Object region)region)
  • 5. BorderLayoutBorderLayout  BorderLayout Defines certain regionBorderLayout Defines certain region -BorderLayout.CENTER-BorderLayout.CENTER -BorderLayout.SOUTH-BorderLayout.SOUTH -BorderLayout.EAST-BorderLayout.EAST -BorderLayout.WEST-BorderLayout.WEST -BorderLayoutNORTH-BorderLayoutNORTH
  • 6. GridLayoutGridLayout  Used to layout Component in twoUsed to layout Component in two dimensional griddimensional grid  Need to define no. of rows & col.Need to define no. of rows & col.  Constructors are-Constructors are- --GridLayout ()GridLayout () - GridLayout(int noRows, int noCols)GridLayout(int noRows, int noCols) - GridLayout(int noRows, int noCols, int horz, int vert)GridLayout(int noRows, int noCols, int horz, int vert)
  • 7. CardLayoutCardLayout  The CardLayout class manages the components inThe CardLayout class manages the components in such a manner that only one component is visible atsuch a manner that only one component is visible at a time. It treats each component as a card that isa time. It treats each component as a card that is why it is known as CardLayout.why it is known as CardLayout.  Constructor are-Constructor are-  CardLayout( )CardLayout( )  CardLayout(intCardLayout(int horz, int vert)horz, int vert)  use this form of add( ) when adding cards to a paneluse this form of add( ) when adding cards to a panel  void add(Componentvoid add(Component panelObj, Object name)panelObj, Object name)
  • 8. CardLayoutCardLayout Methods defined byMethods defined by CardLayoutCardLayout  void first(Containervoid first(Container deck)deck)  void last(Containervoid last(Container deck)deck)  void next(Containervoid next(Container deck)deck)  void previous(Containervoid previous(Container deck)deck)  void show(Containervoid show(Container deck, String cardName)deck, String cardName)
  • 9. GridbagLayoutGridbagLayout  The class GridBagLayout arranges components inThe class GridBagLayout arranges components in a horizontal and vertical manner Implements simplea horizontal and vertical manner Implements simple layout stylelayout style  each GridBagLayout object maintains a dynamic,each GridBagLayout object maintains a dynamic, rectangular grid of cells, with each componentrectangular grid of cells, with each component occupying one or more cellsoccupying one or more cells  Constructor are-Constructor are-  GridBagLayout()GridBagLayout()  Method used to set constraintsMethod used to set constraints -void setContsraints(Component-void setContsraints(Component comp,Gridbagconstraints cns)comp,Gridbagconstraints cns)
  • 10. GridbagLayoutGridbagLayout Absolute ValuesAbsolute Values  GridBagConstraints.NORTHGridBagConstraints.NORTH GridBagConstraints.SOUTHGridBagConstraints.SOUTH GridBagConstraints.WESTGridBagConstraints.WEST GridBagConstraints.EASTGridBagConstraints.EAST GridBagConstraints.NORTHWESTGridBagConstraints.NORTHWEST GridBagConstraints.NORTHEASTGridBagConstraints.NORTHEAST GridBagConstraints.SOUTHWESTGridBagConstraints.SOUTHWEST GridBagConstraints.SOUTHEASTGridBagConstraints.SOUTHEAST GridBagConstraints.CENTER (the default)GridBagConstraints.CENTER (the default)
  • 11. GridbagLayoutGridbagLayout Orientation Relative ValuesOrientation Relative Values  GridBagConstraints.PAGE_STARTGridBagConstraints.PAGE_START GridBagConstraints.PAGE_ENDGridBagConstraints.PAGE_END GridBagConstraints.LINE_STARTGridBagConstraints.LINE_START GridBagConstraints.LINE_ENDGridBagConstraints.LINE_END GridBagConstraints.FIRST_LINE_STARTGridBagConstraints.FIRST_LINE_START GridBagConstraints.FIRST_LINE_ENDGridBagConstraints.FIRST_LINE_END GridBagConstraints.LAST_LINE_STARTGridBagConstraints.LAST_LINE_START GridBagConstraints.LAST_LINE_ENDGridBagConstraints.LAST_LINE_END
  • 12. GridbagLayoutGridbagLayout Baseline Relative ValuesBaseline Relative Values  GridBagConstraints.BASELINEGridBagConstraints.BASELINE GridBagConstraints.BASELINE_LEADINGGridBagConstraints.BASELINE_LEADING GridBagConstraints.BASELINE_TRAILINGGridBagConstraints.BASELINE_TRAILING GridBagConstraints.ABOVE_BASELINEGridBagConstraints.ABOVE_BASELINE GridBagConstraints.ABOVE_BASELINE_LEADINGGridBagConstraints.ABOVE_BASELINE_LEADING GridBagConstraints.ABOVE_BASELINE_TRAILINGGridBagConstraints.ABOVE_BASELINE_TRAILING GridBagConstraints.BELOW_BASELINEGridBagConstraints.BELOW_BASELINE GridBagConstraints.BELOW_BASELINE_LEADINGGridBagConstraints.BELOW_BASELINE_LEADING GridBagConstraints.BELOW_BASELINE_TRAILINGGridBagConstraints.BELOW_BASELINE_TRAILING

Editor's Notes

  1. MFC was introduced in 1992. VB created in 1991. Replaced by VB.NET. MS stopped supporting VB in 2005. ASP first developed in 1996. Used VBScript. “Write once, test everywhere.” – Hooks to OS or hardware specific devices means Java code must be changed.
  2. C#'s principal designer and lead architect at Microsoft is Anders Hejlsberg who also developed Turbo Pascal, Borland Delphi, and Visual J++. C++/CLI (Common Language Infrastructure) supersedes managed C++. It contains new syntax that helps clarify if using managed or unmanaged memory. http://en.wikipedia.org/wiki/C%2B%2B/CLI Managed vs. unmanaged code. What is the advantage of running managed code? Of running unmanaged code?
  3. C#'s principal designer and lead architect at Microsoft is Anders Hejlsberg who also developed Turbo Pascal, Borland Delphi, and Visual J++. C++/CLI (Common Language Infrastructure) supersedes managed C++. It contains new syntax that helps clarify if using managed or unmanaged memory. http://en.wikipedia.org/wiki/C%2B%2B/CLI Managed vs. unmanaged code. What is the advantage of running managed code? Of running unmanaged code?
  4. C#'s principal designer and lead architect at Microsoft is Anders Hejlsberg who also developed Turbo Pascal, Borland Delphi, and Visual J++. C++/CLI (Common Language Infrastructure) supersedes managed C++. It contains new syntax that helps clarify if using managed or unmanaged memory. http://en.wikipedia.org/wiki/C%2B%2B/CLI Managed vs. unmanaged code. What is the advantage of running managed code? Of running unmanaged code?
  5. C#'s principal designer and lead architect at Microsoft is Anders Hejlsberg who also developed Turbo Pascal, Borland Delphi, and Visual J++. C++/CLI (Common Language Infrastructure) supersedes managed C++. It contains new syntax that helps clarify if using managed or unmanaged memory. http://en.wikipedia.org/wiki/C%2B%2B/CLI Managed vs. unmanaged code. What is the advantage of running managed code? Of running unmanaged code?
  6. C#'s principal designer and lead architect at Microsoft is Anders Hejlsberg who also developed Turbo Pascal, Borland Delphi, and Visual J++. C++/CLI (Common Language Infrastructure) supersedes managed C++. It contains new syntax that helps clarify if using managed or unmanaged memory. http://en.wikipedia.org/wiki/C%2B%2B/CLI Managed vs. unmanaged code. What is the advantage of running managed code? Of running unmanaged code?
  7. C#'s principal designer and lead architect at Microsoft is Anders Hejlsberg who also developed Turbo Pascal, Borland Delphi, and Visual J++. C++/CLI (Common Language Infrastructure) supersedes managed C++. It contains new syntax that helps clarify if using managed or unmanaged memory. http://en.wikipedia.org/wiki/C%2B%2B/CLI Managed vs. unmanaged code. What is the advantage of running managed code? Of running unmanaged code?
  8. C#'s principal designer and lead architect at Microsoft is Anders Hejlsberg who also developed Turbo Pascal, Borland Delphi, and Visual J++. C++/CLI (Common Language Infrastructure) supersedes managed C++. It contains new syntax that helps clarify if using managed or unmanaged memory. http://en.wikipedia.org/wiki/C%2B%2B/CLI Managed vs. unmanaged code. What is the advantage of running managed code? Of running unmanaged code?
  9. C#'s principal designer and lead architect at Microsoft is Anders Hejlsberg who also developed Turbo Pascal, Borland Delphi, and Visual J++. C++/CLI (Common Language Infrastructure) supersedes managed C++. It contains new syntax that helps clarify if using managed or unmanaged memory. http://en.wikipedia.org/wiki/C%2B%2B/CLI Managed vs. unmanaged code. What is the advantage of running managed code? Of running unmanaged code?
  10. C#'s principal designer and lead architect at Microsoft is Anders Hejlsberg who also developed Turbo Pascal, Borland Delphi, and Visual J++. C++/CLI (Common Language Infrastructure) supersedes managed C++. It contains new syntax that helps clarify if using managed or unmanaged memory. http://en.wikipedia.org/wiki/C%2B%2B/CLI Managed vs. unmanaged code. What is the advantage of running managed code? Of running unmanaged code?
  11. C#'s principal designer and lead architect at Microsoft is Anders Hejlsberg who also developed Turbo Pascal, Borland Delphi, and Visual J++. C++/CLI (Common Language Infrastructure) supersedes managed C++. It contains new syntax that helps clarify if using managed or unmanaged memory. http://en.wikipedia.org/wiki/C%2B%2B/CLI Managed vs. unmanaged code. What is the advantage of running managed code? Of running unmanaged code?