SlideShare a Scribd company logo
1 of 13
SIMPLE GUI I/O
Chapter 11.1:
Graphical User Interface
๏‚ž In Java, GUI-based programs are implemented by
using classes from the javax.swing and java.awt
packages.
๏‚ž The Swing classes provide greater compatibility
across different operating systems. They are fully
implemented in Java, and behave the same on
different operating systems.
Various Java GUI Components
from the javax.swing package
Button
Label Text
field
Check
Box
Radio
Button
Combo Box
Sample GUI Objects
๏‚ž Various GUI components from the javax.swing
package.
AWT Class Hierarchy (java.awt
package) AWTEvent
Font
FontMetrics
Component
Graphics
Object Color
Canvas
Button
TextComponent
Label
List
CheckBoxGroup
CheckBox
Choice
Container Panel Applet
Frame
Dialog FileDialog
Window
TextField
TextArea
MenuComponent MenuItem
MenuBar
Menu
Scrollbar
LayoutManager
Swing Class Hierarchy
(javax.swing)
Dimension
Font
FontMetrics
Component
Graphics
Object Color
Container
Panel Applet
Frame
Dialog
Window
JComponent
JApplet
JFrame
JDialog
Swing Components
in the javax.swing package
Lightweight
Classes in the java.awt
package
1
LayoutManager
*
GUI Classes
๏‚ž Can be classified into three groups
๏‚— Container classes
โ—‹ Ex: JFrame, JPanel, Japplet
โ—‹ To contain other components
๏‚— Helper classes
โ—‹ Graphics, Color, Font, etc
โ—‹ Used by components and containers to draw
and place objects
๏‚— Component classes
โ—‹ JButton, JTextField, ETC are subclasses of
JComponent
Container Classes
Dimension
Font
FontMetrics
Component
Graphics
Object Color
Container
Panel Applet
Frame
Dialog
Window
JComponent
JApplet
JFrame
JDialog
Swing Components
in the javax.swing package
Lightweight
Heavyweight
Classes in the java.awt
package
1
LayoutManager
*
JPanel
Container classes can
contain other GUI
components.
Container Classes
๏‚ž Used to contain other GUI components
๏‚ž Window, Panel, Frame, Dialog and Applet
are the container classes for AWT
components
๏‚ž To work with Swing components, use
Component, Container, JFrame,
JPanel,JDialog and JApplet
๏‚ž Container
๏‚— Used to group components.
๏‚— A layout manager is used to position and place
components in container
๏‚— Ex. Frames, panels and applets
Container Classes
๏‚ž Jframe
๏‚— Is a window not contained inside another window. It
is the container that holds other swing UI
components
๏‚ž Jpanel
๏‚— An invisible container that holds UI components
๏‚— Panel can be nested
๏‚— Can place panels inside a container that includes a
panel
๏‚ž Jdialog
๏‚— A pop-up windows or message box to receive
additional information from the user or provide
notification that an event has occurred
๏‚ž JApplet โ€“ a subclass of Applet. Must extend
JApplet to create a Swing-based applet
GUI Helper Classes
Dimension
Font
FontMetrics
Component
Graphics
Object Color
Container
Panel Applet
Frame
Dialog
Window
JComponent
JApplet
JFrame
JDialog
Swing Components
in the javax.swing package
Lightweight
Heavyweight
Classes in the java.awt
package
1
LayoutManager
*
JPanelThe helper classes are not
subclasses of Component. They
are used to describe the
properties of GUI components
such as graphics context, colors,
fonts, and dimension.
Swing GUI Components
๏‚ž Component is a superclass of all the UI
classes
๏‚ž JComponent is a superclass of all the
lightweight Swing components
๏‚ž JComponent is an abstract class, cannot
use new JComponent to create an
instance of Jcomponent
๏‚ž Use the constructor of subclasses of
JComponent to create JComponent
instances.
๏‚ž An instance of a subclass can invoke the
accessible method defined in its superclass
Swing GUI Components โ€“ class
hierarchy
JMenuItem
JCheckBoxMenuItem
AbstractButton
JComponent
JMenu
JRadioButtonMenuItem
JToggleButton JCheckBox
JRadioButton
JComboBox
JInternalFrame
JLayeredPane
JList
JMenuBar
JOptionPane
JPopupMenu
JProgressBar
JFileChooser
JScrollBar
JScrollPaneJSeparatorJSplitPane
JSlider
JTabbedPane
JTable JTableHeader
JTextFieldJTextComponent
JTextArea
JToolBar JToolTip
JTree
JRootPane
JPanel
JPasswordField
JColorChooser
JLabel
JEditorPane
JSpinner
JButton

More Related Content

What's hot

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 Javababak danyal
ย 
Java swing
Java swingJava swing
Java swingApurbo Datta
ย 
GUI components in Java
GUI components in JavaGUI components in Java
GUI components in Javakirupasuchi1996
ย 
tL19 awt
tL19 awttL19 awt
tL19 awtteach4uin
ย 
Chapter11 graphical components
Chapter11 graphical componentsChapter11 graphical components
Chapter11 graphical componentsArifa Fatima
ย 
AWT controls, Listeners
AWT controls, ListenersAWT controls, Listeners
AWT controls, ListenersKalai Selvi
ย 
Java: GUI
Java: GUIJava: GUI
Java: GUITareq Hasan
ย 
Java swing and events
Java swing and eventsJava swing and events
Java swing and eventsPrathamesh sawant
ย 
Java swing
Java swingJava swing
Java swingArati Gadgil
ย 
Java awt tutorial javatpoint
Java awt tutorial   javatpointJava awt tutorial   javatpoint
Java awt tutorial javatpointRicardo Garcia
ย 
Controls events
Controls eventsControls events
Controls eventsDalwin INDIA
ย 
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 AWTDrRajeshreeKhande
ย 
Visual basic 6.0
Visual basic 6.0Visual basic 6.0
Visual basic 6.0Aarti P
ย 
Step by step abap_input help or lov
Step by step abap_input help or lovStep by step abap_input help or lov
Step by step abap_input help or lovMilind Patil
ย 
Gui programming a review - mixed content
Gui programming   a review - mixed contentGui programming   a review - mixed content
Gui programming a review - mixed contentYogesh Kumar
ย 
Unit 7 Java
Unit 7 JavaUnit 7 Java
Unit 7 Javaarnold 7490
ย 

What's hot (20)

Awt and swing in java
Awt and swing in javaAwt and swing in java
Awt and swing in java
ย 
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
ย 
Java swing
Java swingJava swing
Java swing
ย 
GUI components in Java
GUI components in JavaGUI components in Java
GUI components in Java
ย 
tL19 awt
tL19 awttL19 awt
tL19 awt
ย 
Chapter11 graphical components
Chapter11 graphical componentsChapter11 graphical components
Chapter11 graphical components
ย 
Java swing 1
Java swing 1Java swing 1
Java swing 1
ย 
AWT controls, Listeners
AWT controls, ListenersAWT controls, Listeners
AWT controls, Listeners
ย 
Java: GUI
Java: GUIJava: GUI
Java: GUI
ย 
Java swing and events
Java swing and eventsJava swing and events
Java swing and events
ย 
Java swing
Java swingJava swing
Java swing
ย 
Java awt tutorial javatpoint
Java awt tutorial   javatpointJava awt tutorial   javatpoint
Java awt tutorial javatpoint
ย 
Controls events
Controls eventsControls events
Controls events
ย 
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
ย 
Visual basic 6.0
Visual basic 6.0Visual basic 6.0
Visual basic 6.0
ย 
Step by step abap_input help or lov
Step by step abap_input help or lovStep by step abap_input help or lov
Step by step abap_input help or lov
ย 
Gui programming a review - mixed content
Gui programming   a review - mixed contentGui programming   a review - mixed content
Gui programming a review - mixed content
ย 
Unit 7 Java
Unit 7 JavaUnit 7 Java
Unit 7 Java
ย 
Java awt
Java awtJava awt
Java awt
ย 
Java
JavaJava
Java
ย 

Similar to Chapter 11.1

Chap1 1 1
Chap1 1 1Chap1 1 1
Chap1 1 1Hemo Chella
ย 
Chap1 1.1
Chap1 1.1Chap1 1.1
Chap1 1.1Hemo Chella
ย 
Computer Programming NC III - Java Swing.pptx
Computer Programming NC III - Java Swing.pptxComputer Programming NC III - Java Swing.pptx
Computer Programming NC III - Java Swing.pptxjonathancapitulo2
ย 
JAVA (UNIT 5)
JAVA (UNIT 5)JAVA (UNIT 5)
JAVA (UNIT 5)SURBHI SAROHA
ย 
JavaYDL12
JavaYDL12JavaYDL12
JavaYDL12Terry Yoast
ย 
Ajp notes-chapter-01
Ajp notes-chapter-01Ajp notes-chapter-01
Ajp notes-chapter-01JONDHLEPOLY
ย 
Graphical User Interface (GUI) - 1
Graphical User Interface (GUI) - 1Graphical User Interface (GUI) - 1
Graphical User Interface (GUI) - 1PRN USM
ย 
Java Swing
Java SwingJava Swing
Java SwingShraddha
ย 
Windows Programming with Swing
Windows Programming with SwingWindows Programming with Swing
Windows Programming with Swingbackdoor
ย 
GUI.pdf
GUI.pdfGUI.pdf
GUI.pdfAbuSufyan82
ย 
SWING USING JAVA WITH VARIOUS COMPONENTS
SWING USING  JAVA WITH VARIOUS COMPONENTSSWING USING  JAVA WITH VARIOUS COMPONENTS
SWING USING JAVA WITH VARIOUS COMPONENTSbharathiv53
ย 
Abstract Window Toolkit
Abstract Window ToolkitAbstract Window Toolkit
Abstract Window ToolkitRutvaThakkar1
ย 
Swingpre 150616004959-lva1-app6892
Swingpre 150616004959-lva1-app6892Swingpre 150616004959-lva1-app6892
Swingpre 150616004959-lva1-app6892renuka gavli
ย 
Swing and AWT in java
Swing and AWT in javaSwing and AWT in java
Swing and AWT in javaAdil Mehmoood
ย 
Java session10
Java session10Java session10
Java session10Niit Care
ย 
Ingles 2do parcial
Ingles   2do parcialIngles   2do parcial
Ingles 2do parcialHarry Ostaiza
ย 
Swing
SwingSwing
SwingFahim Khan
ย 

Similar to Chapter 11.1 (20)

Chap1 1 1
Chap1 1 1Chap1 1 1
Chap1 1 1
ย 
Chap1 1.1
Chap1 1.1Chap1 1.1
Chap1 1.1
ย 
Computer Programming NC III - Java Swing.pptx
Computer Programming NC III - Java Swing.pptxComputer Programming NC III - Java Swing.pptx
Computer Programming NC III - Java Swing.pptx
ย 
JAVA (UNIT 5)
JAVA (UNIT 5)JAVA (UNIT 5)
JAVA (UNIT 5)
ย 
JavaYDL12
JavaYDL12JavaYDL12
JavaYDL12
ย 
12slide
12slide12slide
12slide
ย 
UNIT-2-AJAVA.pdf
UNIT-2-AJAVA.pdfUNIT-2-AJAVA.pdf
UNIT-2-AJAVA.pdf
ย 
Ajp notes-chapter-01
Ajp notes-chapter-01Ajp notes-chapter-01
Ajp notes-chapter-01
ย 
Graphical User Interface (GUI) - 1
Graphical User Interface (GUI) - 1Graphical User Interface (GUI) - 1
Graphical User Interface (GUI) - 1
ย 
Java Swing
Java SwingJava Swing
Java Swing
ย 
Windows Programming with Swing
Windows Programming with SwingWindows Programming with Swing
Windows Programming with Swing
ย 
GUI.pdf
GUI.pdfGUI.pdf
GUI.pdf
ย 
SWING USING JAVA WITH VARIOUS COMPONENTS
SWING USING  JAVA WITH VARIOUS COMPONENTSSWING USING  JAVA WITH VARIOUS COMPONENTS
SWING USING JAVA WITH VARIOUS COMPONENTS
ย 
Abstract Window Toolkit
Abstract Window ToolkitAbstract Window Toolkit
Abstract Window Toolkit
ย 
Swingpre 150616004959-lva1-app6892
Swingpre 150616004959-lva1-app6892Swingpre 150616004959-lva1-app6892
Swingpre 150616004959-lva1-app6892
ย 
Swing and AWT in java
Swing and AWT in javaSwing and AWT in java
Swing and AWT in java
ย 
Java session10
Java session10Java session10
Java session10
ย 
GUI.pptx
GUI.pptxGUI.pptx
GUI.pptx
ย 
Ingles 2do parcial
Ingles   2do parcialIngles   2do parcial
Ingles 2do parcial
ย 
Swing
SwingSwing
Swing
ย 

More from sotlsoc

Chapter 2.0 new
Chapter 2.0 newChapter 2.0 new
Chapter 2.0 newsotlsoc
ย 
Chapter 1.0 new
Chapter 1.0 newChapter 1.0 new
Chapter 1.0 newsotlsoc
ย 
Chapter 3.0 new
Chapter 3.0 newChapter 3.0 new
Chapter 3.0 newsotlsoc
ย 
Chapter 6.5 new
Chapter 6.5 newChapter 6.5 new
Chapter 6.5 newsotlsoc
ย 
Chapter 10.3
Chapter 10.3Chapter 10.3
Chapter 10.3sotlsoc
ย 
Chapter 11.4
Chapter 11.4Chapter 11.4
Chapter 11.4sotlsoc
ย 
Chapter 11.3
Chapter 11.3Chapter 11.3
Chapter 11.3sotlsoc
ย 
Chapter 11.5
Chapter 11.5Chapter 11.5
Chapter 11.5sotlsoc
ย 
Chapter 11.2
Chapter 11.2Chapter 11.2
Chapter 11.2sotlsoc
ย 
Chapter 11.0
Chapter 11.0Chapter 11.0
Chapter 11.0sotlsoc
ย 
Chapter 10.2
Chapter 10.2Chapter 10.2
Chapter 10.2sotlsoc
ย 
Chapter 10.1
Chapter 10.1Chapter 10.1
Chapter 10.1sotlsoc
ย 
Chapter 8.0
Chapter 8.0Chapter 8.0
Chapter 8.0sotlsoc
ย 
Chapter 10.0
Chapter 10.0Chapter 10.0
Chapter 10.0sotlsoc
ย 
Chapter 9.3
Chapter 9.3Chapter 9.3
Chapter 9.3sotlsoc
ย 
Chapter 9.4
Chapter 9.4Chapter 9.4
Chapter 9.4sotlsoc
ย 
Chapter 9.1
Chapter 9.1Chapter 9.1
Chapter 9.1sotlsoc
ย 
Chapter 8.1
Chapter 8.1Chapter 8.1
Chapter 8.1sotlsoc
ย 
Chapter 9.0
Chapter 9.0Chapter 9.0
Chapter 9.0sotlsoc
ย 
Chapter 9.2
Chapter 9.2Chapter 9.2
Chapter 9.2sotlsoc
ย 

More from sotlsoc (20)

Chapter 2.0 new
Chapter 2.0 newChapter 2.0 new
Chapter 2.0 new
ย 
Chapter 1.0 new
Chapter 1.0 newChapter 1.0 new
Chapter 1.0 new
ย 
Chapter 3.0 new
Chapter 3.0 newChapter 3.0 new
Chapter 3.0 new
ย 
Chapter 6.5 new
Chapter 6.5 newChapter 6.5 new
Chapter 6.5 new
ย 
Chapter 10.3
Chapter 10.3Chapter 10.3
Chapter 10.3
ย 
Chapter 11.4
Chapter 11.4Chapter 11.4
Chapter 11.4
ย 
Chapter 11.3
Chapter 11.3Chapter 11.3
Chapter 11.3
ย 
Chapter 11.5
Chapter 11.5Chapter 11.5
Chapter 11.5
ย 
Chapter 11.2
Chapter 11.2Chapter 11.2
Chapter 11.2
ย 
Chapter 11.0
Chapter 11.0Chapter 11.0
Chapter 11.0
ย 
Chapter 10.2
Chapter 10.2Chapter 10.2
Chapter 10.2
ย 
Chapter 10.1
Chapter 10.1Chapter 10.1
Chapter 10.1
ย 
Chapter 8.0
Chapter 8.0Chapter 8.0
Chapter 8.0
ย 
Chapter 10.0
Chapter 10.0Chapter 10.0
Chapter 10.0
ย 
Chapter 9.3
Chapter 9.3Chapter 9.3
Chapter 9.3
ย 
Chapter 9.4
Chapter 9.4Chapter 9.4
Chapter 9.4
ย 
Chapter 9.1
Chapter 9.1Chapter 9.1
Chapter 9.1
ย 
Chapter 8.1
Chapter 8.1Chapter 8.1
Chapter 8.1
ย 
Chapter 9.0
Chapter 9.0Chapter 9.0
Chapter 9.0
ย 
Chapter 9.2
Chapter 9.2Chapter 9.2
Chapter 9.2
ย 

Recently uploaded

mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
ย 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
ย 
โ€œOh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
โ€œOh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...โ€œOh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
โ€œOh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
ย 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
ย 
call girls in Kamla Market (DELHI) ๐Ÿ” >เผ’9953330565๐Ÿ” genuine Escort Service ๐Ÿ”โœ”๏ธโœ”๏ธ
call girls in Kamla Market (DELHI) ๐Ÿ” >เผ’9953330565๐Ÿ” genuine Escort Service ๐Ÿ”โœ”๏ธโœ”๏ธcall girls in Kamla Market (DELHI) ๐Ÿ” >เผ’9953330565๐Ÿ” genuine Escort Service ๐Ÿ”โœ”๏ธโœ”๏ธ
call girls in Kamla Market (DELHI) ๐Ÿ” >เผ’9953330565๐Ÿ” genuine Escort Service ๐Ÿ”โœ”๏ธโœ”๏ธ9953056974 Low Rate Call Girls In Saket, Delhi NCR
ย 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
ย 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting DataJhengPantaleon
ย 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
ย 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
ย 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
ย 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
ย 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
ย 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
ย 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
ย 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
ย 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
ย 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
ย 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
ย 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
ย 

Recently uploaded (20)

mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
ย 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
ย 
โ€œOh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
โ€œOh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...โ€œOh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
โ€œOh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
ย 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
ย 
call girls in Kamla Market (DELHI) ๐Ÿ” >เผ’9953330565๐Ÿ” genuine Escort Service ๐Ÿ”โœ”๏ธโœ”๏ธ
call girls in Kamla Market (DELHI) ๐Ÿ” >เผ’9953330565๐Ÿ” genuine Escort Service ๐Ÿ”โœ”๏ธโœ”๏ธcall girls in Kamla Market (DELHI) ๐Ÿ” >เผ’9953330565๐Ÿ” genuine Escort Service ๐Ÿ”โœ”๏ธโœ”๏ธ
call girls in Kamla Market (DELHI) ๐Ÿ” >เผ’9953330565๐Ÿ” genuine Escort Service ๐Ÿ”โœ”๏ธโœ”๏ธ
ย 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
ย 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
ย 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
ย 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
ย 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
ย 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
ย 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
ย 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
ย 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
ย 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
ย 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
ย 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
ย 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
ย 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
ย 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
ย 

Chapter 11.1

  • 2. Graphical User Interface ๏‚ž In Java, GUI-based programs are implemented by using classes from the javax.swing and java.awt packages. ๏‚ž The Swing classes provide greater compatibility across different operating systems. They are fully implemented in Java, and behave the same on different operating systems.
  • 3. Various Java GUI Components from the javax.swing package Button Label Text field Check Box Radio Button Combo Box
  • 4. Sample GUI Objects ๏‚ž Various GUI components from the javax.swing package.
  • 5. AWT Class Hierarchy (java.awt package) AWTEvent Font FontMetrics Component Graphics Object Color Canvas Button TextComponent Label List CheckBoxGroup CheckBox Choice Container Panel Applet Frame Dialog FileDialog Window TextField TextArea MenuComponent MenuItem MenuBar Menu Scrollbar LayoutManager
  • 6. Swing Class Hierarchy (javax.swing) Dimension Font FontMetrics Component Graphics Object Color Container Panel Applet Frame Dialog Window JComponent JApplet JFrame JDialog Swing Components in the javax.swing package Lightweight Classes in the java.awt package 1 LayoutManager *
  • 7. GUI Classes ๏‚ž Can be classified into three groups ๏‚— Container classes โ—‹ Ex: JFrame, JPanel, Japplet โ—‹ To contain other components ๏‚— Helper classes โ—‹ Graphics, Color, Font, etc โ—‹ Used by components and containers to draw and place objects ๏‚— Component classes โ—‹ JButton, JTextField, ETC are subclasses of JComponent
  • 8. Container Classes Dimension Font FontMetrics Component Graphics Object Color Container Panel Applet Frame Dialog Window JComponent JApplet JFrame JDialog Swing Components in the javax.swing package Lightweight Heavyweight Classes in the java.awt package 1 LayoutManager * JPanel Container classes can contain other GUI components.
  • 9. Container Classes ๏‚ž Used to contain other GUI components ๏‚ž Window, Panel, Frame, Dialog and Applet are the container classes for AWT components ๏‚ž To work with Swing components, use Component, Container, JFrame, JPanel,JDialog and JApplet ๏‚ž Container ๏‚— Used to group components. ๏‚— A layout manager is used to position and place components in container ๏‚— Ex. Frames, panels and applets
  • 10. Container Classes ๏‚ž Jframe ๏‚— Is a window not contained inside another window. It is the container that holds other swing UI components ๏‚ž Jpanel ๏‚— An invisible container that holds UI components ๏‚— Panel can be nested ๏‚— Can place panels inside a container that includes a panel ๏‚ž Jdialog ๏‚— A pop-up windows or message box to receive additional information from the user or provide notification that an event has occurred ๏‚ž JApplet โ€“ a subclass of Applet. Must extend JApplet to create a Swing-based applet
  • 11. GUI Helper Classes Dimension Font FontMetrics Component Graphics Object Color Container Panel Applet Frame Dialog Window JComponent JApplet JFrame JDialog Swing Components in the javax.swing package Lightweight Heavyweight Classes in the java.awt package 1 LayoutManager * JPanelThe helper classes are not subclasses of Component. They are used to describe the properties of GUI components such as graphics context, colors, fonts, and dimension.
  • 12. Swing GUI Components ๏‚ž Component is a superclass of all the UI classes ๏‚ž JComponent is a superclass of all the lightweight Swing components ๏‚ž JComponent is an abstract class, cannot use new JComponent to create an instance of Jcomponent ๏‚ž Use the constructor of subclasses of JComponent to create JComponent instances. ๏‚ž An instance of a subclass can invoke the accessible method defined in its superclass
  • 13. Swing GUI Components โ€“ class hierarchy JMenuItem JCheckBoxMenuItem AbstractButton JComponent JMenu JRadioButtonMenuItem JToggleButton JCheckBox JRadioButton JComboBox JInternalFrame JLayeredPane JList JMenuBar JOptionPane JPopupMenu JProgressBar JFileChooser JScrollBar JScrollPaneJSeparatorJSplitPane JSlider JTabbedPane JTable JTableHeader JTextFieldJTextComponent JTextArea JToolBar JToolTip JTree JRootPane JPanel JPasswordField JColorChooser JLabel JEditorPane JSpinner JButton