1. introduction to swing
TRANSCRIPT
![Page 1: 1. introduction to swing](https://reader034.vdocuments.site/reader034/viewer/2022052618/554eba88b4c905de468b4695/html5/thumbnails/1.jpg)
Introduction to
Swing
![Page 2: 1. introduction to swing](https://reader034.vdocuments.site/reader034/viewer/2022052618/554eba88b4c905de468b4695/html5/thumbnails/2.jpg)
What is Swing? a set of customizable graphical components
![Page 3: 1. introduction to swing](https://reader034.vdocuments.site/reader034/viewer/2022052618/554eba88b4c905de468b4695/html5/thumbnails/3.jpg)
Not just!
![Page 4: 1. introduction to swing](https://reader034.vdocuments.site/reader034/viewer/2022052618/554eba88b4c905de468b4695/html5/thumbnails/4.jpg)
Not only a set of customizable graphical components
but also next-generation GUI toolkit for enterprise dev
![Page 5: 1. introduction to swing](https://reader034.vdocuments.site/reader034/viewer/2022052618/554eba88b4c905de468b4695/html5/thumbnails/5.jpg)
Not only a set of customizable graphical components
but also next-generation GUI toolkit for enterprise dev
![Page 6: 1. introduction to swing](https://reader034.vdocuments.site/reader034/viewer/2022052618/554eba88b4c905de468b4695/html5/thumbnails/6.jpg)
Why was Swing born?
![Page 7: 1. introduction to swing](https://reader034.vdocuments.site/reader034/viewer/2022052618/554eba88b4c905de468b4695/html5/thumbnails/7.jpg)
History <<
![Page 8: 1. introduction to swing](https://reader034.vdocuments.site/reader034/viewer/2022052618/554eba88b4c905de468b4695/html5/thumbnails/8.jpg)
Java James Gosling
1991
![Page 9: 1. introduction to swing](https://reader034.vdocuments.site/reader034/viewer/2022052618/554eba88b4c905de468b4695/html5/thumbnails/9.jpg)
AWT (Abstract Window Toolkit) is the only one toolkit to develop GUI in initial Java
is based on peer-components
![Page 10: 1. introduction to swing](https://reader034.vdocuments.site/reader034/viewer/2022052618/554eba88b4c905de468b4695/html5/thumbnails/10.jpg)
What is peer-components?
![Page 11: 1. introduction to swing](https://reader034.vdocuments.site/reader034/viewer/2022052618/554eba88b4c905de468b4695/html5/thumbnails/11.jpg)
AWT (Abstract Window Toolkit) #Prob1: similar components not the same in different OS
=> maintenance nightmare
#Prob2: limited functionalities, expensive on memory.
![Page 12: 1. introduction to swing](https://reader034.vdocuments.site/reader034/viewer/2022052618/554eba88b4c905de468b4695/html5/thumbnails/12.jpg)
AWT (Abstract Window Toolkit) is not enough!
![Page 13: 1. introduction to swing](https://reader034.vdocuments.site/reader034/viewer/2022052618/554eba88b4c905de468b4695/html5/thumbnails/13.jpg)
Aha!!! That’s why Swing was born.
![Page 14: 1. introduction to swing](https://reader034.vdocuments.site/reader034/viewer/2022052618/554eba88b4c905de468b4695/html5/thumbnails/14.jpg)
JFC (Java Foundation Classes) JavaSoft
1997 – JavaOne Confer. in San Francisco
![Page 15: 1. introduction to swing](https://reader034.vdocuments.site/reader034/viewer/2022052618/554eba88b4c905de468b4695/html5/thumbnails/15.jpg)
JFC (Java Foundation Classes)
![Page 16: 1. introduction to swing](https://reader034.vdocuments.site/reader034/viewer/2022052618/554eba88b4c905de468b4695/html5/thumbnails/16.jpg)
Swing’s feature: Pluggable Look-and-Feels
Lightweight Components
Additional Feature
![Page 17: 1. introduction to swing](https://reader034.vdocuments.site/reader034/viewer/2022052618/554eba88b4c905de468b4695/html5/thumbnails/17.jpg)
Swing is based on MVC Architecture
![Page 18: 1. introduction to swing](https://reader034.vdocuments.site/reader034/viewer/2022052618/554eba88b4c905de468b4695/html5/thumbnails/18.jpg)
MVC Model: the state of data for each component
View: how you see the component
Controller: how the component interacts with event
![Page 19: 1. introduction to swing](https://reader034.vdocuments.site/reader034/viewer/2022052618/554eba88b4c905de468b4695/html5/thumbnails/19.jpg)
MVC in Swing simplified model-delegate
![Page 20: 1. introduction to swing](https://reader034.vdocuments.site/reader034/viewer/2022052618/554eba88b4c905de468b4695/html5/thumbnails/20.jpg)
MVC in Swing simplified model-delegate
![Page 21: 1. introduction to swing](https://reader034.vdocuments.site/reader034/viewer/2022052618/554eba88b4c905de468b4695/html5/thumbnails/21.jpg)
A Container contains components.
![Page 22: 1. introduction to swing](https://reader034.vdocuments.site/reader034/viewer/2022052618/554eba88b4c905de468b4695/html5/thumbnails/22.jpg)
Two types of containers: Top-level General-purpose
![Page 23: 1. introduction to swing](https://reader034.vdocuments.site/reader034/viewer/2022052618/554eba88b4c905de468b4695/html5/thumbnails/23.jpg)
Dig into container
![Page 24: 1. introduction to swing](https://reader034.vdocuments.site/reader034/viewer/2022052618/554eba88b4c905de468b4695/html5/thumbnails/24.jpg)
Glass pane
![Page 25: 1. introduction to swing](https://reader034.vdocuments.site/reader034/viewer/2022052618/554eba88b4c905de468b4695/html5/thumbnails/25.jpg)
Layered pane
![Page 26: 1. introduction to swing](https://reader034.vdocuments.site/reader034/viewer/2022052618/554eba88b4c905de468b4695/html5/thumbnails/26.jpg)
Content pane
![Page 27: 1. introduction to swing](https://reader034.vdocuments.site/reader034/viewer/2022052618/554eba88b4c905de468b4695/html5/thumbnails/27.jpg)
Menu pane
![Page 28: 1. introduction to swing](https://reader034.vdocuments.site/reader034/viewer/2022052618/554eba88b4c905de468b4695/html5/thumbnails/28.jpg)
Let’s imagine see the real things.
![Page 29: 1. introduction to swing](https://reader034.vdocuments.site/reader034/viewer/2022052618/554eba88b4c905de468b4695/html5/thumbnails/29.jpg)
Lightweight component referred Swing components
![Page 30: 1. introduction to swing](https://reader034.vdocuments.site/reader034/viewer/2022052618/554eba88b4c905de468b4695/html5/thumbnails/30.jpg)
JLabel JButton JCheckbox JRadioButton JTextField JTextArea
JPasswordField
![Page 31: 1. introduction to swing](https://reader034.vdocuments.site/reader034/viewer/2022052618/554eba88b4c905de468b4695/html5/thumbnails/31.jpg)
Homeworks
Do the workshop in Introduction to Swing follow video demo.
Read Swing components and Dialog Box