SlideShare a Scribd company logo
GUI
 A graphical user interface (GUI) presents a pictorial
interface to a program, GUI's allow the user to work in a
more productive manner.
 A GUI component is an object with which the user
interacts via the mouse or keyboard, below are some of
the Java GUI components
Graphical User Interface in JAVA
 Some of the basic GUI components are
 JLabelAn area where uneditable text or icons can be displayed
 JTextFieldAn area where the user inputs data from the keyboard,
this area can also display data
 JButtonAn area that triggers an event when clicked
 JCheckBoxA GUI component that is either selected or not
selected
 JComboBoxA drop-down list of items from which the user can
make a selection by clicking an item in the list or typing into the box
 JListAn area where a list of items is displayed from which the user
can make a selection by clicking once on any element in the list.
Double-clicking an element in the list generates an action event,
Multiple elements can be selected
 JPanelA container in which components can be placed
Java Layout Managers
 The GUI is made up of a number of components, the
Layout Managers affect the content pane.
 Layout Managers are provided to arrange GUI
components on a container for presentation purposes.
This allows the programmer to concentrate on the basic
"look and feel" and lets the layout managers process
most of the layout details
Graphical User Interface in JAVA
 Several AWT and Swing classes provide layout managers
for general use:
1. BorderLayout
2. BoxLayout
3. CardLayout
4. FlowLayout
5. GridBagLayout
6. GridLayout
7. GroupLayout
8. SpringLayout
Here are 5 of the layout managers.
BorderLayout
 The class BorderLayout arranges the components to fit
in the five regions: east, west, north, south and center.
Each region is can contain only one component and each
component in each region is identified by the
corresponding constant NORTH, SOUTH, EAST, WEST,
and CENTER.
 Class declaration
 Following is the declaration
for java.awt.BorderLayout class:
 public class BorderLayout extends Object implements
LayoutManager2, Serializable
 Here are the constructors defined by BorderLayout:
1. BorderLayout()
2. BorderLayout(int horz, int vert)
the first form creates a default border layout. The second
allows you to specify the horizontal and vertical space left
between components in horz and vert, respectively.
BorderLayout defines the following constants that specify
the regions.
BorderLayout.CENTER, BorderLayout.SOUTH,
BorderLayout.EAST, BorderLayout.WEST,
BorderLayout.NORTH
Graphical User Interface in JAVA
CardLayout
 The class CardLayout arranges each component in the
container as a card. Only one card is visible at a time, and
the container acts as a stack of cards.
 Class declaration
 Following is the declaration
for java.awt.CardLayout class:
 public class CardLayout extends Object implements
LayoutManager2, Serializable
 CardLayout provides these two constructors:
1. CardLayout()
2. CardLayout(int horz, int vert)
Graphical User Interface in JAVA
FlowLayout 
 The class FlowLayout components in a left-to-right
flow.
 This is the most basic layout manager, components are
placed from left to right as they were added, when the
edge is reached the components are put on the next line.
You can align the components left, right or center
(default).
 Class declaration
 Following is the declaration
for java.awt.FlowLayout class:
 public class FlowLayout extends Object implements
LayoutManager, Serializable
 Here are the constructors for FlowLayout:
1. FlowLayout()
2. FlowLayout(int how)
3. FlowLayout(int how, int horz, int vert)
The first form creates the default layout, which centers
components and leaves five pixels of space between each
component. The second form lets you specify how each
line is aligned. Valid values of how are as follows:
FlowLayout.LEFT
FlowLayout.CENTER
FlowLayout.RIGHT
Graphical User Interface in JAVA
GridLayout 
 Introduction
 The class GridLayout arranges components in a
rectangular grid.
 Class declaration
 Following is the declaration
for java.awt.GridLayout class:
 public class GridLayout extends Object implements
LayoutManager, Serializable
 GridLayout are shown here:
1. GridLayout()
2. GridLayout(int numRows, int numColumns)
3. GridLayout(int numRows, int numColumns, int horz, int
vert)
GridBagLayout 
 The class GridBagLayout arranges components in a
horizontal and vertical manner.
 Class declaration
 Following is the declaration
for java.awt.GridBagLayout class:
 public class GridBagLayout extends Object implements
LayoutManager2, Serializable
Graphical User Interface in JAVA
GroupLayout 
 GroupLayout is a layout manager that was developed for use
by GUI builder tools, but it can also be used
manually. GroupLayout works with the horizontal and vertical
layouts separately. The layout is defined for each dimension
independently. Consequently, however, each component
needs to be defined twice in the layout. The Find window
shown above is an example of a GroupLayout. .
 Class declaration
 Following is the declaration
for javax.swing.GroupLayout class:
 public class GroupLayout extends Object implements
LayoutManager2
Graphical User Interface in JAVA
SpringLayout
 SpringLayout is a flexible layout manager designed for use by
GUI builders. It lets you specify precise relationships between
the edges of components under its control. For example, you
might define that the left edge of one component is a certain
distance (which can be dynamically calculated) from the right
edge of a second component.SpringLayout lays out the
children of its associated container according to a set of
constraints, as shall be seen in
 Class declaration
 Following is the declaration
for javax.swing.SpringLayout class:
 public class SpringLayout extends Object implements
LayoutManager2
Graphical User Interface in JAVA
Graphical User Interface in JAVA
Ad

Recommended

Java awt (abstract window toolkit)
Java awt (abstract window toolkit)
Elizabeth alexander
 
Exception handling
Exception handling
PhD Research Scholar
 
Java I/o streams
Java I/o streams
Hamid Ghorbani
 
History Of JAVA
History Of JAVA
ARSLANAHMED107
 
INHERITANCE IN JAVA.pptx
INHERITANCE IN JAVA.pptx
NITHISG1
 
Java: GUI
Java: GUI
Tareq Hasan
 
Abstract Class & Abstract Method in Core Java
Abstract Class & Abstract Method in Core Java
MOHIT AGARWAL
 
JAVA AWT
JAVA AWT
shanmuga rajan
 
Data Types & Variables in JAVA
Data Types & Variables in JAVA
Ankita Totala
 
Exception Handling in JAVA
Exception Handling in JAVA
SURIT DATTA
 
Event Handling in java
Event Handling in java
Google
 
I/O Streams
I/O Streams
Ravi Chythanya
 
Java exception handling
Java exception handling
BHUVIJAYAVELU
 
Basic Concepts of OOPs (Object Oriented Programming in Java)
Basic Concepts of OOPs (Object Oriented Programming in Java)
Michelle Anne Meralpis
 
Applets
Applets
Prabhakaran V M
 
Java abstract class & abstract methods
Java abstract class & abstract methods
Shubham Dwivedi
 
Wrapper classes
Wrapper classes
Kongu Engineering College, Perundurai, Erode
 
Packages in java
Packages in java
Elizabeth alexander
 
Java IO Package and Streams
Java IO Package and Streams
babak danyal
 
Type casting in java
Type casting in java
Farooq Baloch
 
Java Tokens
Java Tokens
Madishetty Prathibha
 
Exception Handling in Java
Exception Handling in Java
lalithambiga kamaraj
 
Working with color and font
Working with color and font
myrajendra
 
Java exception
Java exception
Arati Gadgil
 
Exception Handling
Exception Handling
Reddhi Basu
 
MULTI THREADING IN JAVA
MULTI THREADING IN JAVA
VINOTH R
 
File Handling In C++(OOPs))
File Handling In C++(OOPs))
Papu Kumar
 
Java packages
Java packages
BHUVIJAYAVELU
 
Graphical User Interface (GUI) - 1
Graphical User Interface (GUI) - 1
PRN USM
 
3_ppt_Layout.pptxgßbdbdbdbsbsbsbbsbsbsbsbsb
3_ppt_Layout.pptxgßbdbdbdbsbsbsbbsbsbsbsbsb
abhishekmathuroffici
 

More Related Content

What's hot (20)

Data Types & Variables in JAVA
Data Types & Variables in JAVA
Ankita Totala
 
Exception Handling in JAVA
Exception Handling in JAVA
SURIT DATTA
 
Event Handling in java
Event Handling in java
Google
 
I/O Streams
I/O Streams
Ravi Chythanya
 
Java exception handling
Java exception handling
BHUVIJAYAVELU
 
Basic Concepts of OOPs (Object Oriented Programming in Java)
Basic Concepts of OOPs (Object Oriented Programming in Java)
Michelle Anne Meralpis
 
Applets
Applets
Prabhakaran V M
 
Java abstract class & abstract methods
Java abstract class & abstract methods
Shubham Dwivedi
 
Wrapper classes
Wrapper classes
Kongu Engineering College, Perundurai, Erode
 
Packages in java
Packages in java
Elizabeth alexander
 
Java IO Package and Streams
Java IO Package and Streams
babak danyal
 
Type casting in java
Type casting in java
Farooq Baloch
 
Java Tokens
Java Tokens
Madishetty Prathibha
 
Exception Handling in Java
Exception Handling in Java
lalithambiga kamaraj
 
Working with color and font
Working with color and font
myrajendra
 
Java exception
Java exception
Arati Gadgil
 
Exception Handling
Exception Handling
Reddhi Basu
 
MULTI THREADING IN JAVA
MULTI THREADING IN JAVA
VINOTH R
 
File Handling In C++(OOPs))
File Handling In C++(OOPs))
Papu Kumar
 
Java packages
Java packages
BHUVIJAYAVELU
 

Similar to Graphical User Interface in JAVA (20)

Graphical User Interface (GUI) - 1
Graphical User Interface (GUI) - 1
PRN USM
 
3_ppt_Layout.pptxgßbdbdbdbsbsbsbbsbsbsbsbsb
3_ppt_Layout.pptxgßbdbdbdbsbsbsbbsbsbsbsbsb
abhishekmathuroffici
 
LAYOUT.pptx
LAYOUT.pptx
aparna14patil
 
Getting started with GUI programming in Java_1
Getting started with GUI programming in Java_1
Muhammad Shebl Farag
 
Layout managementand event handling
Layout managementand event handling
Charli Patel
 
swingbasics
swingbasics
Arjun Shanka
 
Abstract Window Toolkit_Event Handling_python
Abstract Window Toolkit_Event Handling_python
jasminebeulahg
 
Swing
Swing
Jaydeep Viradiya
 
Java gives us layout managers whose responsibility it is to determine.docx
Java gives us layout managers whose responsibility it is to determine.docx
olsenlinnea427
 
Windows Programming with AWT
Windows Programming with AWT
backdoor
 
8layout Managers
8layout Managers
Adil Jafri
 
java swing
java swing
Waheed Warraich
 
Lecture 6.pdf
Lecture 6.pdf
SakhilejasonMsibi
 
VsisbsvdisvdkdbdidvdkdbdifjdfbjffAWT.pptx
VsisbsvdisvdkdbdidvdkdbdifjdfbjffAWT.pptx
ChetanRaut43
 
Java GUI PART II
Java GUI PART II
OXUS 20
 
Java GUI Programming for beginners-graphics.pdf
Java GUI Programming for beginners-graphics.pdf
PBMaverick
 
Understanding layout managers
Understanding layout managers
Nuha Noor
 
AWT.pptx
AWT.pptx
MumtazAli889808
 
JEDI Slides-Intro2-Chapter19-Abstract Windowing Toolkit and Swing.pdf
JEDI Slides-Intro2-Chapter19-Abstract Windowing Toolkit and Swing.pdf
MarlouFelixIIICunana
 
Layout manager
Layout manager
Shree M.L.Kakadiya MCA mahila college, Amreli
 
Graphical User Interface (GUI) - 1
Graphical User Interface (GUI) - 1
PRN USM
 
3_ppt_Layout.pptxgßbdbdbdbsbsbsbbsbsbsbsbsb
3_ppt_Layout.pptxgßbdbdbdbsbsbsbbsbsbsbsbsb
abhishekmathuroffici
 
Getting started with GUI programming in Java_1
Getting started with GUI programming in Java_1
Muhammad Shebl Farag
 
Layout managementand event handling
Layout managementand event handling
Charli Patel
 
Abstract Window Toolkit_Event Handling_python
Abstract Window Toolkit_Event Handling_python
jasminebeulahg
 
Java gives us layout managers whose responsibility it is to determine.docx
Java gives us layout managers whose responsibility it is to determine.docx
olsenlinnea427
 
Windows Programming with AWT
Windows Programming with AWT
backdoor
 
8layout Managers
8layout Managers
Adil Jafri
 
VsisbsvdisvdkdbdidvdkdbdifjdfbjffAWT.pptx
VsisbsvdisvdkdbdidvdkdbdifjdfbjffAWT.pptx
ChetanRaut43
 
Java GUI PART II
Java GUI PART II
OXUS 20
 
Java GUI Programming for beginners-graphics.pdf
Java GUI Programming for beginners-graphics.pdf
PBMaverick
 
Understanding layout managers
Understanding layout managers
Nuha Noor
 
JEDI Slides-Intro2-Chapter19-Abstract Windowing Toolkit and Swing.pdf
JEDI Slides-Intro2-Chapter19-Abstract Windowing Toolkit and Swing.pdf
MarlouFelixIIICunana
 
Ad

More from suraj pandey (20)

Systemcare in computer
Systemcare in computer
suraj pandey
 
vb.net Constructor and destructor
vb.net Constructor and destructor
suraj pandey
 
Overloading and overriding in vb.net
Overloading and overriding in vb.net
suraj pandey
 
Basic in Computernetwork
Basic in Computernetwork
suraj pandey
 
Computer hardware
Computer hardware
suraj pandey
 
Dos commands new
Dos commands new
suraj pandey
 
History of computer
History of computer
suraj pandey
 
Dos commands
Dos commands
suraj pandey
 
Basic of Internet&email
Basic of Internet&email
suraj pandey
 
Basic fundamental Computer input/output Accessories
Basic fundamental Computer input/output Accessories
suraj pandey
 
Introduction of exception in vb.net
Introduction of exception in vb.net
suraj pandey
 
Transmission mediums in computer networks
Transmission mediums in computer networks
suraj pandey
 
Introduction to vb.net
Introduction to vb.net
suraj pandey
 
Introduction to computer
Introduction to computer
suraj pandey
 
Computer Fundamental Network topologies
Computer Fundamental Network topologies
suraj pandey
 
Basic of Computer software
Basic of Computer software
suraj pandey
 
Basic using of Swing in Java
Basic using of Swing in Java
suraj pandey
 
Basic Networking in Java
Basic Networking in Java
suraj pandey
 
Basic Java Database Connectivity(JDBC)
Basic Java Database Connectivity(JDBC)
suraj pandey
 
Generics in java
Generics in java
suraj pandey
 
Systemcare in computer
Systemcare in computer
suraj pandey
 
vb.net Constructor and destructor
vb.net Constructor and destructor
suraj pandey
 
Overloading and overriding in vb.net
Overloading and overriding in vb.net
suraj pandey
 
Basic in Computernetwork
Basic in Computernetwork
suraj pandey
 
History of computer
History of computer
suraj pandey
 
Basic of Internet&email
Basic of Internet&email
suraj pandey
 
Basic fundamental Computer input/output Accessories
Basic fundamental Computer input/output Accessories
suraj pandey
 
Introduction of exception in vb.net
Introduction of exception in vb.net
suraj pandey
 
Transmission mediums in computer networks
Transmission mediums in computer networks
suraj pandey
 
Introduction to vb.net
Introduction to vb.net
suraj pandey
 
Introduction to computer
Introduction to computer
suraj pandey
 
Computer Fundamental Network topologies
Computer Fundamental Network topologies
suraj pandey
 
Basic of Computer software
Basic of Computer software
suraj pandey
 
Basic using of Swing in Java
Basic using of Swing in Java
suraj pandey
 
Basic Networking in Java
Basic Networking in Java
suraj pandey
 
Basic Java Database Connectivity(JDBC)
Basic Java Database Connectivity(JDBC)
suraj pandey
 
Ad

Recently uploaded (20)

Environmental Science, Environmental Health, and Sanitation – Unit 3 | B.Sc N...
Environmental Science, Environmental Health, and Sanitation – Unit 3 | B.Sc N...
RAKESH SAJJAN
 
Tanja Vujicic - PISA for Schools contact Info
Tanja Vujicic - PISA for Schools contact Info
EduSkills OECD
 
How to Customize Quotation Layouts in Odoo 18
How to Customize Quotation Layouts in Odoo 18
Celine George
 
Plate Tectonic Boundaries and Continental Drift Theory
Plate Tectonic Boundaries and Continental Drift Theory
Marie
 
GREAT QUIZ EXCHANGE 2025 - GENERAL QUIZ.pptx
GREAT QUIZ EXCHANGE 2025 - GENERAL QUIZ.pptx
Ronisha Das
 
“THE BEST CLASS IN SCHOOL”. _
“THE BEST CLASS IN SCHOOL”. _
Colégio Santa Teresinha
 
IIT KGP Quiz Week 2024 Sports Quiz (Prelims + Finals)
IIT KGP Quiz Week 2024 Sports Quiz (Prelims + Finals)
IIT Kharagpur Quiz Club
 
Nutrition Assessment and Nutrition Education – Unit 4 | B.Sc Nursing 5th Seme...
Nutrition Assessment and Nutrition Education – Unit 4 | B.Sc Nursing 5th Seme...
RAKESH SAJJAN
 
Non-Communicable Diseases and National Health Programs – Unit 10 | B.Sc Nursi...
Non-Communicable Diseases and National Health Programs – Unit 10 | B.Sc Nursi...
RAKESH SAJJAN
 
2025 June Year 9 Presentation: Subject selection.pptx
2025 June Year 9 Presentation: Subject selection.pptx
mansk2
 
Assisting Individuals and Families to Promote and Maintain Health – Unit 7 | ...
Assisting Individuals and Families to Promote and Maintain Health – Unit 7 | ...
RAKESH SAJJAN
 
Publishing Your Memoir with Brooke Warner
Publishing Your Memoir with Brooke Warner
Brooke Warner
 
Code Profiling in Odoo 18 - Odoo 18 Slides
Code Profiling in Odoo 18 - Odoo 18 Slides
Celine George
 
LDMMIA Yoga S10 Free Workshop Grad Level
LDMMIA Yoga S10 Free Workshop Grad Level
LDM & Mia eStudios
 
Sustainable Innovation with Immersive Learning
Sustainable Innovation with Immersive Learning
Leonel Morgado
 
ROLE PLAY: FIRST AID -CPR & RECOVERY POSITION.pptx
ROLE PLAY: FIRST AID -CPR & RECOVERY POSITION.pptx
Belicia R.S
 
Communicable Diseases and National Health Programs – Unit 9 | B.Sc Nursing 5t...
Communicable Diseases and National Health Programs – Unit 9 | B.Sc Nursing 5t...
RAKESH SAJJAN
 
SPENT QUIZ NQL JR FEST 5.0 BY SOURAV.pptx
SPENT QUIZ NQL JR FEST 5.0 BY SOURAV.pptx
Sourav Kr Podder
 
K12 Tableau User Group virtual event June 18, 2025
K12 Tableau User Group virtual event June 18, 2025
dogden2
 
Values Education 10 Quarter 1 Module .pptx
Values Education 10 Quarter 1 Module .pptx
JBPafin
 
Environmental Science, Environmental Health, and Sanitation – Unit 3 | B.Sc N...
Environmental Science, Environmental Health, and Sanitation – Unit 3 | B.Sc N...
RAKESH SAJJAN
 
Tanja Vujicic - PISA for Schools contact Info
Tanja Vujicic - PISA for Schools contact Info
EduSkills OECD
 
How to Customize Quotation Layouts in Odoo 18
How to Customize Quotation Layouts in Odoo 18
Celine George
 
Plate Tectonic Boundaries and Continental Drift Theory
Plate Tectonic Boundaries and Continental Drift Theory
Marie
 
GREAT QUIZ EXCHANGE 2025 - GENERAL QUIZ.pptx
GREAT QUIZ EXCHANGE 2025 - GENERAL QUIZ.pptx
Ronisha Das
 
IIT KGP Quiz Week 2024 Sports Quiz (Prelims + Finals)
IIT KGP Quiz Week 2024 Sports Quiz (Prelims + Finals)
IIT Kharagpur Quiz Club
 
Nutrition Assessment and Nutrition Education – Unit 4 | B.Sc Nursing 5th Seme...
Nutrition Assessment and Nutrition Education – Unit 4 | B.Sc Nursing 5th Seme...
RAKESH SAJJAN
 
Non-Communicable Diseases and National Health Programs – Unit 10 | B.Sc Nursi...
Non-Communicable Diseases and National Health Programs – Unit 10 | B.Sc Nursi...
RAKESH SAJJAN
 
2025 June Year 9 Presentation: Subject selection.pptx
2025 June Year 9 Presentation: Subject selection.pptx
mansk2
 
Assisting Individuals and Families to Promote and Maintain Health – Unit 7 | ...
Assisting Individuals and Families to Promote and Maintain Health – Unit 7 | ...
RAKESH SAJJAN
 
Publishing Your Memoir with Brooke Warner
Publishing Your Memoir with Brooke Warner
Brooke Warner
 
Code Profiling in Odoo 18 - Odoo 18 Slides
Code Profiling in Odoo 18 - Odoo 18 Slides
Celine George
 
LDMMIA Yoga S10 Free Workshop Grad Level
LDMMIA Yoga S10 Free Workshop Grad Level
LDM & Mia eStudios
 
Sustainable Innovation with Immersive Learning
Sustainable Innovation with Immersive Learning
Leonel Morgado
 
ROLE PLAY: FIRST AID -CPR & RECOVERY POSITION.pptx
ROLE PLAY: FIRST AID -CPR & RECOVERY POSITION.pptx
Belicia R.S
 
Communicable Diseases and National Health Programs – Unit 9 | B.Sc Nursing 5t...
Communicable Diseases and National Health Programs – Unit 9 | B.Sc Nursing 5t...
RAKESH SAJJAN
 
SPENT QUIZ NQL JR FEST 5.0 BY SOURAV.pptx
SPENT QUIZ NQL JR FEST 5.0 BY SOURAV.pptx
Sourav Kr Podder
 
K12 Tableau User Group virtual event June 18, 2025
K12 Tableau User Group virtual event June 18, 2025
dogden2
 
Values Education 10 Quarter 1 Module .pptx
Values Education 10 Quarter 1 Module .pptx
JBPafin
 

Graphical User Interface in JAVA

  • 1. GUI
  • 2.  A graphical user interface (GUI) presents a pictorial interface to a program, GUI's allow the user to work in a more productive manner.  A GUI component is an object with which the user interacts via the mouse or keyboard, below are some of the Java GUI components
  • 4.  Some of the basic GUI components are  JLabelAn area where uneditable text or icons can be displayed  JTextFieldAn area where the user inputs data from the keyboard, this area can also display data  JButtonAn area that triggers an event when clicked  JCheckBoxA GUI component that is either selected or not selected  JComboBoxA drop-down list of items from which the user can make a selection by clicking an item in the list or typing into the box  JListAn area where a list of items is displayed from which the user can make a selection by clicking once on any element in the list. Double-clicking an element in the list generates an action event, Multiple elements can be selected  JPanelA container in which components can be placed
  • 5. Java Layout Managers  The GUI is made up of a number of components, the Layout Managers affect the content pane.  Layout Managers are provided to arrange GUI components on a container for presentation purposes. This allows the programmer to concentrate on the basic "look and feel" and lets the layout managers process most of the layout details
  • 7.  Several AWT and Swing classes provide layout managers for general use: 1. BorderLayout 2. BoxLayout 3. CardLayout 4. FlowLayout 5. GridBagLayout 6. GridLayout 7. GroupLayout 8. SpringLayout
  • 8. Here are 5 of the layout managers.
  • 9. BorderLayout  The class BorderLayout arranges the components to fit in the five regions: east, west, north, south and center. Each region is can contain only one component and each component in each region is identified by the corresponding constant NORTH, SOUTH, EAST, WEST, and CENTER.  Class declaration  Following is the declaration for java.awt.BorderLayout class:  public class BorderLayout extends Object implements LayoutManager2, Serializable
  • 10.  Here are the constructors defined by BorderLayout: 1. BorderLayout() 2. BorderLayout(int horz, int vert) the first form creates a default border layout. The second allows you to specify the horizontal and vertical space left between components in horz and vert, respectively. BorderLayout defines the following constants that specify the regions. BorderLayout.CENTER, BorderLayout.SOUTH, BorderLayout.EAST, BorderLayout.WEST, BorderLayout.NORTH
  • 12. CardLayout  The class CardLayout arranges each component in the container as a card. Only one card is visible at a time, and the container acts as a stack of cards.  Class declaration  Following is the declaration for java.awt.CardLayout class:  public class CardLayout extends Object implements LayoutManager2, Serializable
  • 13.  CardLayout provides these two constructors: 1. CardLayout() 2. CardLayout(int horz, int vert)
  • 15. FlowLayout   The class FlowLayout components in a left-to-right flow.  This is the most basic layout manager, components are placed from left to right as they were added, when the edge is reached the components are put on the next line. You can align the components left, right or center (default).  Class declaration  Following is the declaration for java.awt.FlowLayout class:  public class FlowLayout extends Object implements LayoutManager, Serializable
  • 16.  Here are the constructors for FlowLayout: 1. FlowLayout() 2. FlowLayout(int how) 3. FlowLayout(int how, int horz, int vert) The first form creates the default layout, which centers components and leaves five pixels of space between each component. The second form lets you specify how each line is aligned. Valid values of how are as follows: FlowLayout.LEFT FlowLayout.CENTER FlowLayout.RIGHT
  • 18. GridLayout   Introduction  The class GridLayout arranges components in a rectangular grid.  Class declaration  Following is the declaration for java.awt.GridLayout class:  public class GridLayout extends Object implements LayoutManager, Serializable
  • 19.  GridLayout are shown here: 1. GridLayout() 2. GridLayout(int numRows, int numColumns) 3. GridLayout(int numRows, int numColumns, int horz, int vert)
  • 20. GridBagLayout   The class GridBagLayout arranges components in a horizontal and vertical manner.  Class declaration  Following is the declaration for java.awt.GridBagLayout class:  public class GridBagLayout extends Object implements LayoutManager2, Serializable
  • 22. GroupLayout   GroupLayout is a layout manager that was developed for use by GUI builder tools, but it can also be used manually. GroupLayout works with the horizontal and vertical layouts separately. The layout is defined for each dimension independently. Consequently, however, each component needs to be defined twice in the layout. The Find window shown above is an example of a GroupLayout. .  Class declaration  Following is the declaration for javax.swing.GroupLayout class:  public class GroupLayout extends Object implements LayoutManager2
  • 24. SpringLayout  SpringLayout is a flexible layout manager designed for use by GUI builders. It lets you specify precise relationships between the edges of components under its control. For example, you might define that the left edge of one component is a certain distance (which can be dynamically calculated) from the right edge of a second component.SpringLayout lays out the children of its associated container according to a set of constraints, as shall be seen in  Class declaration  Following is the declaration for javax.swing.SpringLayout class:  public class SpringLayout extends Object implements LayoutManager2