SlideShare a Scribd company logo
IADCS Diploma Course Swing Programming U Nyein Oo COO/Director(IT) Myanma Computer Co.,
Java Foundation Classes? Set of Java Class Libraries provides as part of J2SE Support building GUI and graphics functionality for Java based Client Application Run on Microsoft Platform and others like Mac OSX and Linux Easily deployed over the web Rich clients for web services
Features of JFC Abstract Windowing Toolkits Java 2D Swing GUI Components Accessibility Internationalization
MVC Architecture Design pattern to Swing UI for JFC Used for constructing entire UI Components Each component has a Model, a View and a Controller. The model, view ,and controller pieces can change even while the component is in use.
MVC Design Pattern Model Controller View Inform the view to update visual Read the contents Update the contents Inform view of state change
What MVC means? Model   is the piece that represents the state and low level behavior of the component. (stored the data or stage of object) View   is the piece that manage the visual display of the state represented by the model Controller  is the piece that manages user interaction with the model.(handle the event)
Benefits using MVC To divded large program to views of documents. A view provides a window into document Multiple views can provide multiple windows into the document.
Swing Programming AWT is the heave weight component and it has a peer object for the native GUI When the components are created they take help of the underlying O/S Java offers Light weight components that do not have a peer object. It now popular by Swing UI components
Why Swing? Uses fewer system resources Add a lot of more sophisticated components Tailor the Look and Feel of program and  Extensing of Existing Components for  - Layout Management -  Event handling - Thread and Swing - Printing ….etc
Swing Basic Swing is set of packages build on top of the AWT with number of prebuild classes(over 250 classes and 40UI components) All swing UI components are started with J for use the terms JFC and Swing interchangeabily
Structure of Swing Components JContainer Classes JComponent Classes All Swing Components
Swing Components Windows Menus AbstractButton Panels Layouts Icons Borders Toolbars Labels Buttons List Boxes Combo Boxes Check Boxes Tables Trees
Sub Classes of the JComponent Class JComponent is the superclass of all swing components. All the components begin with the letter ‘J’. JComponent has the following subclasses:  AbstractButton class   JButton & JLabel class   JButton   JLabel   JComboBox class   JCheckBox class   Jlist Jmenu JPopupMenu JProgressBar JScrollBar JRadioButton Jseparator Jtable JTextComponent JToolBar JTree
Swing Packages Swing Package Description javax.swing Contains components, adapters, component models and interfaces. It is the highest-level swing package. javax.swing.basic Contains the user interface classes that implement the look and feel for swing components. javax.swing.border Declares the border interface, and classes defining the specific border styles. javax.swing.plaf Contains the plugable look and feel API. javax.swing.table Contains the interfaces and classes supporting the swing table component. javax.swing.text Contains the support classes for the swing document framework. javax.swing.event Defines the events and event listeners.  javax.swing.tree Provides classes and interfaces that support the JTree component. javax.swing.undo Provides support classes for undo/redo operations.
Swing Event Handling For a Java program to run, the interface should be made receptive to user events   Swing handles events with a set of classes called ‘event listeners’   javax.swing.event package defines a set of event listening interfaces and event classes so that they can used with Swing components   There are various events defined in the javax.swing.event package, such as: ChangeEvent   DragEvent   ListDataEvent   ListSelectionEvent   TableModelEvent   TableColumnEvent
Look and Feel Swing is a real improvement to the AWT, since it supplies rich set of platform GUI components   Platform independence means the components within it are supported across all Java ports   Enables the look and feel of the components to be easily tailored   This is called as Pluggable Look and Feel (L&F) of the swing components   This helps us to create applets and applications that have a look and feel independent to the window platform in which they are executed
Look and Feel Cont; The look and feel consists of the way the program is presented to the user (looks) & the way user interacts with it (feels).  Swing provides the capability to change the look and feel of the applet or application.  Swing components are not tied to GUI components. It is because of this that we can create applets or applications that will use a specific look and feel. Look and feel is a function of view and controller.
Thank You
1. Frame Test
3. Label Test
4. Button Test
6. Text Area Test
7. CheckBox and Radio Button
8. Listtest Test
9. Color Change Test
10. Editable TextArea Test
11. Border Test
12. Calcuator
13. Combo Example
14. Menu Example
15. Popup Menu Example
16. DialogBox Test
17. Table Test
18. Progress Bar Test
19. Tooltips Test
20. Color Chooser Test
21. File Chooser Test

More Related Content

What's hot (16)

PPTX
Introduction to java
princeirfancivil
 
PPTX
Java. converted (2)
AVINASHMEHRA6
 
PDF
What is Java
3trg
 
PPTX
Java Basics
Khan625
 
DOC
Report swings
Alisha Korpal
 
PPTX
Introduction to java
javeed_mhd
 
PPTX
Java- GUI- Mazenet solution
Mazenetsolution
 
PPT
Java Programming for Designers
R. Sosa
 
PPTX
Introduction to java
Saba Ameer
 
PDF
Java Swing Custom GUI MVC Component Tutorial
Sagun Dhakhwa
 
PDF
Introduction to Java
Professional Guru
 
PDF
108 advancedjava
Anil Kumar
 
PPTX
JAVA PPT by NAVEEN TOKAS
NAVEEN TOKAS
 
PPTX
Intro to Java
karianneban
 
DOC
Strayer cis 406 week 10 assignment 2 u grade new
dixonbakerr
 
Introduction to java
princeirfancivil
 
Java. converted (2)
AVINASHMEHRA6
 
What is Java
3trg
 
Java Basics
Khan625
 
Report swings
Alisha Korpal
 
Introduction to java
javeed_mhd
 
Java- GUI- Mazenet solution
Mazenetsolution
 
Java Programming for Designers
R. Sosa
 
Introduction to java
Saba Ameer
 
Java Swing Custom GUI MVC Component Tutorial
Sagun Dhakhwa
 
Introduction to Java
Professional Guru
 
108 advancedjava
Anil Kumar
 
JAVA PPT by NAVEEN TOKAS
NAVEEN TOKAS
 
Intro to Java
karianneban
 
Strayer cis 406 week 10 assignment 2 u grade new
dixonbakerr
 

Viewers also liked (20)

PPT
Feliz Navidad
contreras
 
PPT
Ibm Collaboration Conference Sept 2007 V5
Nick Davis
 
PPT
Web 2 Tools4309
Donggi heo
 
PPT
Rehearsal Markings
lmsabol
 
PPT
AWT Program output
backdoor
 
PPT
Измерение информации
guest579319
 
PPS
Tulipanes Holanda
cristiandadypatria
 
PPT
Hey Buddy, How About A Lift
hosss
 
PPS
Los Borbones
Sergi Ferrús
 
PPT
Evaluacion Revista Anales de Documentacion
l02peamj
 
PPS
Slide Pq[1]. Ecol Gico
edmartino
 
PPT
Power Point
guest4ffe24
 
PPT
Feliz Navidad Nou Barris
SOBRE-RUEDAS.ORG
 
PDF
Premios Accesibilidad 2007
Fundacion DFA
 
PPT
El Estres
mitchel1277
 
PPT
S207 2 X Advent Cc
drs
 
PPT
Feliz Navidad
SOBRE-RUEDAS.ORG
 
PPT
Workspacewiki
sscott2
 
PPT
Componentes
contreras
 
PPT
C4000
Roobsa
 
Feliz Navidad
contreras
 
Ibm Collaboration Conference Sept 2007 V5
Nick Davis
 
Web 2 Tools4309
Donggi heo
 
Rehearsal Markings
lmsabol
 
AWT Program output
backdoor
 
Измерение информации
guest579319
 
Tulipanes Holanda
cristiandadypatria
 
Hey Buddy, How About A Lift
hosss
 
Los Borbones
Sergi Ferrús
 
Evaluacion Revista Anales de Documentacion
l02peamj
 
Slide Pq[1]. Ecol Gico
edmartino
 
Power Point
guest4ffe24
 
Feliz Navidad Nou Barris
SOBRE-RUEDAS.ORG
 
Premios Accesibilidad 2007
Fundacion DFA
 
El Estres
mitchel1277
 
S207 2 X Advent Cc
drs
 
Feliz Navidad
SOBRE-RUEDAS.ORG
 
Workspacewiki
sscott2
 
Componentes
contreras
 
C4000
Roobsa
 
Ad

Similar to Windows Programming with Swing (20)

PPTX
Java_Unit6pptx__2024_04_13_18_18_07.pptx
lakhatariyajaimin09
 
PPTX
Chapter 1 swings
Jafar Nesargi
 
PPTX
Swing components
Sameenafathima4
 
PPT
GUI design using JAVAFX.ppt
TabassumMaktum
 
PPTX
JAVA (UNIT 5)
Dr. SURBHI SAROHA
 
PPT
Slot04 creating gui
Viên Mai
 
PPT
Java Land F
guestc55e903c
 
PPT
Java Land F
guestc55e903c
 
PPT
Java Land F
guestc55e903c
 
PPT
Java Land F
guestc55e903c
 
PPT
Java Land F
guestc55e903c
 
PPT
Java Land F
guestc55e903c
 
PPTX
Java_unit_1_AWTvsSwing.pptxn k , jlnninikkn
zmulani8
 
PPT
GUI Programming In Java
yht4ever
 
PDF
Java swing 1
Mukesh Tekwani
 
PPTX
SWING USING JAVA WITH VARIOUS COMPONENTS
bharathiv53
 
PDF
Lecture 19
Debasish Pratihari
 
PPTX
Advanced java lab swing mvc awt
vishal choudhary
 
PPTX
SWING-AWT_Overview of Swing and AWT.pptx
SVENISHA
 
PPTX
JAVA AWT presentation for awt key events.pptx
ShubhamNain11
 
Java_Unit6pptx__2024_04_13_18_18_07.pptx
lakhatariyajaimin09
 
Chapter 1 swings
Jafar Nesargi
 
Swing components
Sameenafathima4
 
GUI design using JAVAFX.ppt
TabassumMaktum
 
JAVA (UNIT 5)
Dr. SURBHI SAROHA
 
Slot04 creating gui
Viên Mai
 
Java Land F
guestc55e903c
 
Java Land F
guestc55e903c
 
Java Land F
guestc55e903c
 
Java Land F
guestc55e903c
 
Java Land F
guestc55e903c
 
Java Land F
guestc55e903c
 
Java_unit_1_AWTvsSwing.pptxn k , jlnninikkn
zmulani8
 
GUI Programming In Java
yht4ever
 
Java swing 1
Mukesh Tekwani
 
SWING USING JAVA WITH VARIOUS COMPONENTS
bharathiv53
 
Lecture 19
Debasish Pratihari
 
Advanced java lab swing mvc awt
vishal choudhary
 
SWING-AWT_Overview of Swing and AWT.pptx
SVENISHA
 
JAVA AWT presentation for awt key events.pptx
ShubhamNain11
 
Ad

More from backdoor (20)

PPT
Java Database Connectivity
backdoor
 
PPT
Distributed Programming using RMI
backdoor
 
PPT
Programming Server side with Sevlet
backdoor
 
PPT
Distributed Programming using RMI
backdoor
 
PPT
Client Side Programming with Applet
backdoor
 
PPT
Java Network Programming
backdoor
 
PPT
Windows Programming with AWT
backdoor
 
PPT
Multithreading
backdoor
 
PPT
Object and Classes in Java
backdoor
 
PPT
IO and serialization
backdoor
 
PPT
Exception Handling
backdoor
 
PPT
Java Intro
backdoor
 
PPT
Object Oriented Programming with Java
backdoor
 
PPT
Net Man
backdoor
 
PPT
Data Security
backdoor
 
PPT
Ne Course Part One
backdoor
 
PPT
Ne Course Part Two
backdoor
 
PPT
Net Sec
backdoor
 
PDF
Security Policy Checklist
backdoor
 
PPT
Bcis Csm Chapter Three
backdoor
 
Java Database Connectivity
backdoor
 
Distributed Programming using RMI
backdoor
 
Programming Server side with Sevlet
backdoor
 
Distributed Programming using RMI
backdoor
 
Client Side Programming with Applet
backdoor
 
Java Network Programming
backdoor
 
Windows Programming with AWT
backdoor
 
Multithreading
backdoor
 
Object and Classes in Java
backdoor
 
IO and serialization
backdoor
 
Exception Handling
backdoor
 
Java Intro
backdoor
 
Object Oriented Programming with Java
backdoor
 
Net Man
backdoor
 
Data Security
backdoor
 
Ne Course Part One
backdoor
 
Ne Course Part Two
backdoor
 
Net Sec
backdoor
 
Security Policy Checklist
backdoor
 
Bcis Csm Chapter Three
backdoor
 

Recently uploaded (20)

PDF
Gabino Barbosa - A Master Of Efficiency
Gabino Barbosa
 
PPTX
Event Budgeting. Various factors to consider for event budgeting
TintoAnil
 
PDF
Top 10 Emerging Tech Trends to Watch in 2025.pdf
marketingyourtechdig
 
PDF
Buy Facebook Accounts Buy Facebook Accounts
darlaknowles49
 
PDF
Smart Lead Magnet Review: Effortless Email List Growth with Automated Funnels...
Larry888358
 
PPTX
Hackathon - Technology - Idea Submission Template -HackerEarth.pptx
nanster236
 
PDF
Maksym Vyshnivetskyi: Управління закупівлями (UA)
Lviv Startup Club
 
PDF
NewBase 03 July 2025 Energy News issue - 1799 by Khaled Al Awadi_compressed.pdf
Khaled Al Awadi
 
PPTX
25 Future Mega Trends Reshaping the World in 2025 and Beyond
presentifyai
 
PDF
Robbie Teehan - Owns The Pro Composer
Robbie Teehan
 
PPTX
Technical Analysis of 1st Generation Biofuel Feedstocks - 25th June 2025
TOFPIK
 
PDF
Top Trends Redefining B2B Apparel Exporting in 2025
ananyaa2255
 
PDF
"Complete Guide to the Partner Visa 2025
Zealand Immigration
 
PPTX
Phygital & Omnichannel Retail: Navigating the Future of Seamless Shopping
RUPAL AGARWAL
 
PPTX
SYMCA LGP - Social Enterprise Exchange.pptx
Social Enterprise Exchange
 
PDF
Two-phase direct-to-chip cooling - Parker Components
Parker Hannifin Corporation
 
PDF
Why Unipac Equipment Leads the Way Among Gantry Crane Manufacturers in Singap...
UnipacEquipment
 
PDF
Cloud Budgeting for Startups: Principles, Strategies, and Tools That Scale
Amnic
 
PDF
Flexible Metal Hose & Custom Hose Assemblies
McGill Hose & Coupling Inc
 
PDF
2018 - Building a Culture By Design PPTX
Cheryl M
 
Gabino Barbosa - A Master Of Efficiency
Gabino Barbosa
 
Event Budgeting. Various factors to consider for event budgeting
TintoAnil
 
Top 10 Emerging Tech Trends to Watch in 2025.pdf
marketingyourtechdig
 
Buy Facebook Accounts Buy Facebook Accounts
darlaknowles49
 
Smart Lead Magnet Review: Effortless Email List Growth with Automated Funnels...
Larry888358
 
Hackathon - Technology - Idea Submission Template -HackerEarth.pptx
nanster236
 
Maksym Vyshnivetskyi: Управління закупівлями (UA)
Lviv Startup Club
 
NewBase 03 July 2025 Energy News issue - 1799 by Khaled Al Awadi_compressed.pdf
Khaled Al Awadi
 
25 Future Mega Trends Reshaping the World in 2025 and Beyond
presentifyai
 
Robbie Teehan - Owns The Pro Composer
Robbie Teehan
 
Technical Analysis of 1st Generation Biofuel Feedstocks - 25th June 2025
TOFPIK
 
Top Trends Redefining B2B Apparel Exporting in 2025
ananyaa2255
 
"Complete Guide to the Partner Visa 2025
Zealand Immigration
 
Phygital & Omnichannel Retail: Navigating the Future of Seamless Shopping
RUPAL AGARWAL
 
SYMCA LGP - Social Enterprise Exchange.pptx
Social Enterprise Exchange
 
Two-phase direct-to-chip cooling - Parker Components
Parker Hannifin Corporation
 
Why Unipac Equipment Leads the Way Among Gantry Crane Manufacturers in Singap...
UnipacEquipment
 
Cloud Budgeting for Startups: Principles, Strategies, and Tools That Scale
Amnic
 
Flexible Metal Hose & Custom Hose Assemblies
McGill Hose & Coupling Inc
 
2018 - Building a Culture By Design PPTX
Cheryl M
 

Windows Programming with Swing

  • 1. IADCS Diploma Course Swing Programming U Nyein Oo COO/Director(IT) Myanma Computer Co.,
  • 2. Java Foundation Classes? Set of Java Class Libraries provides as part of J2SE Support building GUI and graphics functionality for Java based Client Application Run on Microsoft Platform and others like Mac OSX and Linux Easily deployed over the web Rich clients for web services
  • 3. Features of JFC Abstract Windowing Toolkits Java 2D Swing GUI Components Accessibility Internationalization
  • 4. MVC Architecture Design pattern to Swing UI for JFC Used for constructing entire UI Components Each component has a Model, a View and a Controller. The model, view ,and controller pieces can change even while the component is in use.
  • 5. MVC Design Pattern Model Controller View Inform the view to update visual Read the contents Update the contents Inform view of state change
  • 6. What MVC means? Model is the piece that represents the state and low level behavior of the component. (stored the data or stage of object) View is the piece that manage the visual display of the state represented by the model Controller is the piece that manages user interaction with the model.(handle the event)
  • 7. Benefits using MVC To divded large program to views of documents. A view provides a window into document Multiple views can provide multiple windows into the document.
  • 8. Swing Programming AWT is the heave weight component and it has a peer object for the native GUI When the components are created they take help of the underlying O/S Java offers Light weight components that do not have a peer object. It now popular by Swing UI components
  • 9. Why Swing? Uses fewer system resources Add a lot of more sophisticated components Tailor the Look and Feel of program and Extensing of Existing Components for - Layout Management - Event handling - Thread and Swing - Printing ….etc
  • 10. Swing Basic Swing is set of packages build on top of the AWT with number of prebuild classes(over 250 classes and 40UI components) All swing UI components are started with J for use the terms JFC and Swing interchangeabily
  • 11. Structure of Swing Components JContainer Classes JComponent Classes All Swing Components
  • 12. Swing Components Windows Menus AbstractButton Panels Layouts Icons Borders Toolbars Labels Buttons List Boxes Combo Boxes Check Boxes Tables Trees
  • 13. Sub Classes of the JComponent Class JComponent is the superclass of all swing components. All the components begin with the letter ‘J’. JComponent has the following subclasses: AbstractButton class JButton & JLabel class JButton JLabel JComboBox class JCheckBox class Jlist Jmenu JPopupMenu JProgressBar JScrollBar JRadioButton Jseparator Jtable JTextComponent JToolBar JTree
  • 14. Swing Packages Swing Package Description javax.swing Contains components, adapters, component models and interfaces. It is the highest-level swing package. javax.swing.basic Contains the user interface classes that implement the look and feel for swing components. javax.swing.border Declares the border interface, and classes defining the specific border styles. javax.swing.plaf Contains the plugable look and feel API. javax.swing.table Contains the interfaces and classes supporting the swing table component. javax.swing.text Contains the support classes for the swing document framework. javax.swing.event Defines the events and event listeners. javax.swing.tree Provides classes and interfaces that support the JTree component. javax.swing.undo Provides support classes for undo/redo operations.
  • 15. Swing Event Handling For a Java program to run, the interface should be made receptive to user events Swing handles events with a set of classes called ‘event listeners’ javax.swing.event package defines a set of event listening interfaces and event classes so that they can used with Swing components There are various events defined in the javax.swing.event package, such as: ChangeEvent DragEvent ListDataEvent ListSelectionEvent TableModelEvent TableColumnEvent
  • 16. Look and Feel Swing is a real improvement to the AWT, since it supplies rich set of platform GUI components Platform independence means the components within it are supported across all Java ports Enables the look and feel of the components to be easily tailored This is called as Pluggable Look and Feel (L&F) of the swing components This helps us to create applets and applications that have a look and feel independent to the window platform in which they are executed
  • 17. Look and Feel Cont; The look and feel consists of the way the program is presented to the user (looks) & the way user interacts with it (feels). Swing provides the capability to change the look and feel of the applet or application. Swing components are not tied to GUI components. It is because of this that we can create applets or applications that will use a specific look and feel. Look and feel is a function of view and controller.
  • 22. 6. Text Area Test
  • 23. 7. CheckBox and Radio Button
  • 31. 15. Popup Menu Example