SlideShare une entreprise Scribd logo
Page:
VDate: lT
Evemt Hamdlimq
Event: Chamqe in status of am abfec
Press a buttom,draq & adrop of moue
EVemt Hamdinq (ompoments
Evenmts
An ewCmt 1s a chanqe in Stufe or m
Ob/ect
Evemt Sorre
Ls m_object fhat qemorates m ewemt
Cistemers
An object fhat istoms to am evmt
A Dstemer. qet motiied when G)
evemt Occcrs
How are eents hmdled ?
O A
sends it with the Sounte to me ov
more /iste es
SOrT Cveny
Omre lisfem rere/ves the Nent, the
eNomt cwill be processed efrDed
o.
7w0 tupeS 01 CYOnts
O Low /0vel evonts
Repreromt direcf commmicatio pom
User
e key_presse Telease
Fo1owmy re lowjeve! ewemh:
0 CmmpdnentEvemt.
FocusE VOm F
keyE vemt
CodtainerEvemt
) WindowEvemt
Page
Date:
Righ 1velevoms: (o Sematc evon
E iCap5u/ates meminq of a_uSer
In1ertuce compovemt
foliowinq ne hiqh lerel' eWmt
OActiomElomd
Adjustm etEvemt (scaol)brr
ZfomE VCNnt
ItemE vem t
TentEv emt
Evemt
ist e 07
Evemt Evemt method
Sore
TTO
Page
Date
1mporf jwca, Swimq.*
impert
/mpo7 (Owa. Gcut. evemt|
owa, a wt.
Class myevemt extemds JFrm2e
J/mp/ememts Achnmtiifem e
mYeN Cmt )
WAAKTRbaReaU DRuttor(iaCLALON,
TeaiFiet cd 1:neuw Jleatfietd (is)
5ellay0uf(new Flowlayout c))
ddl(b)
abebeiady
JButfom 90w JButtm ("clic/e ");
b.adelActicm listomer (this)
add (b);_
SefSie 200,2o0)
Sef Vib/e (_frue)
Setpetqult ClosedperaiOm JFoame EX TT_ONLa
public e void ActIonPetormed(AchenFvew
tsetTeat(" Heluo")
P.s vmShimq oqs)
myevt m 2ew_myevetC)
Page
Date:
aivodeupened
class MWind exkord inm
Label A1
Mhlind O
seldayeAut
add
add
Windeuli his)
public NO1d uindou Opened(ndnuend
ttseTet winoudoftnad
Page
V Date
Windouwtisten r Clas
public class windowerample eatemdJs
JFrome implemens Windowlistem er
o b j e e t
u A t
be
2 0 q
s t o r c 4
abtornpsneAt.
WimdowLIMp/ e )
dddwimdowListemer (this)
SetSie 400,400o
Setlayout ( mul)
SetVishb/e (frue)
ps.v.m Stvinq t) oqs
windowexamp ie w new window exmple)
pubiicvoid windowAciuted (WmdouwEveB e )
S.op." achivafed ");
pubiic vord wmdowClosog(WindowEvemt e
S.0.p. (" closimq")
public voic wmdowDeach vated (
Wim dowEvent e)
S 0 p.(" Deact vated");
Page
Date:
Java Adopter Classes
Provides deroult implem
emtutioon
of isteme intortares
Lf we /nhomit the adap1or
class
we will not be force d topovioe
/272p/ememtuh m ut au methods or
istene 1ntvrtuces. So t Saves
ode.
Owa. awt.ew Omt/tdapter
ListomeTIntertace
Wimdo wBdo listem er WImdowPoapt py
KeyListemex
MtaselUTtene
MouseMoionLisfemoY
A.dapter Class
Keyfdapter
Focuststemor
Lompom entlistener
CntwnertistenY
Hieaarhy3oumdslitener
public Class CwindowCXOmp/e extermds
Thepe Windorwhdapfer
windouGKONp/e ()
JFrme new RPe ()
1.addwIn dowlistener e Nirdaurdopdto4)
sefize (300,300)ISeflayoui (mulu)
sef Visible ( frue)
p.s,V, m ( Shinq I qs)
CUmdOwOCmpiew New wIndocvCXqYple0
Page
V Date:
public vojd wimdowClosinq(WindowEVon e)
S.op ( windocw_clored").
dvantug es
Reuseability of classes
Makes císes more visibe
Omretated closses cm wOr
toerher
Snme class cm be usedim my Cwaus
Page:
T
Date:I|
/17ONYmoUs InnerClass 17mCwa
ZmeC/ass without mome
Cmly Simqle. object iÍ oeoted
J
Defn:
A claSs thaf hos No manme kmowr
as cm momymous /nmer class
Used you howe to 0ove7dp
a method of tlass /7tetare
Cm be ceatecd 1 tw0 waysS
O ClasS ( abstoa ct r comTe1e
InteÍo Ce_
abstra ct class_pOIOn
abstadct yoid eat.()
class est
P.Sym 51nmqtj_aqS)_
Peoscm N etw peISON t)
V0id eat () OvCrTide
.0p Nire"):
p eat )__
Page:
Date: L
inter tace
/nictu ce_eatable
void eat c)
Class fest
eatuble e mew eatoble()_
override
pubiic yoic eat C)
S.op(Nice"
e.eatt
Page
Date:
Jmemy Relat ecd classe
JmemBar, TMemu JMenulfem
pant of swimq packaqe
JMemuBar ttaimsJMemu dbjects
J Memu 0b/ect awhem seiectecidiplca
DOpop Showimq Cme c more JMemdTfe
are
COms1auctor
Tmemu Bar (
Tmen )
Tm emu Stvmg mame
Methods
add Tmemu C)_
add ( Compmemt c)
dd Compomemt n t imdea
add d Stzin S)-Oppend
JMenaBar mb: mew J17or7UKr()
Imemut: ew TMemu ("_File");_
e 22ew TMenu ("Edit")
Jmenultem o : mecw 7Memwl1em["pon
.add o)_
Page
Date:
TFile ChooseN Swinq).
CJsed to selec a hl, folder by arer
Constouctoa
Jfie ChoosCr () -User odefault dizectoay
TF7e Chooser(SIrinq) - qivn path
ThieCh00s File P)-q/te fe as poh
Method
I show0penDialoq()
getSelectecl Frle )
e1Ab solutePath )
TCol-Chods er
Used to Create a color chooser dialoq
bo so that Us er com serect om COtbr.
Constructor
(O) Jolorhooser C) '
Osed. to crcate a Color cChoosCr pOmej
Cvifh white co/0 /nitially
TColor Choosor color initialco lor)
OIsed to cyeate a colo choose pmej
CWIth Specifred coro initally .
Methods
O vord addchooserPamet (Absbartlolorhoasfar
Pmei)
Us ed to add a colochoose prmetto the
color hooso
O stat1C (olo shocw DIalo q ( Compooomt c
Stormq tifie'Color mialCo10r)
CsedU to show color choasco dialoq bo
Page
Date
DialoqS Messaqe,
Contirmatom)1rp)F
TAle Ghooser, JCOlorChoose
Dialoq windocw is am /ndepemdem
Sabcuim do w to show femPorrY Noe
apart hom maun Swlng
Most dialoqs poesont C eot
_ Cuorn
ihq 7o User bu dialo94 C
po esomt mbqes, dioectory tres
TO Ceate mple dialoqs you Cn
ImP
appn cwindea
USe OptionPome class
TWO Othor closses TToloochooser P
JHethoaser Supply Stom dad dialoqs
Dialo q b0
C M1ode aialog bon
(3 modeless didloq box
UNIT 5- AWT AND SWING.pdf

Contenu connexe

Dernier

UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2DianaGray10
 
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptxWSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptxJennifer Lim
 
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya HalderCustom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya HalderCzechDreamin
 
Demystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyDemystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyJohn Staveley
 
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomSalesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomCzechDreamin
 
Enterprise Security Monitoring, And Log Management.
Enterprise Security Monitoring, And Log Management.Enterprise Security Monitoring, And Log Management.
Enterprise Security Monitoring, And Log Management.Boni Yeamin
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Jeffrey Haguewood
 
A Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System StrategyA Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System StrategyUXDXConf
 
Introduction to Open Source RAG and RAG Evaluation
Introduction to Open Source RAG and RAG EvaluationIntroduction to Open Source RAG and RAG Evaluation
Introduction to Open Source RAG and RAG EvaluationZilliz
 
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)Julian Hyde
 
Designing for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at ComcastDesigning for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at ComcastUXDXConf
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaRTTS
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonDianaGray10
 
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераMark Opanasiuk
 
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...CzechDreamin
 
What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024Stephanie Beckett
 
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...CzechDreamin
 
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀DianaGray10
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupCatarinaPereira64715
 
AI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří KarpíšekAI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří KarpíšekCzechDreamin
 

Dernier (20)

UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2
 
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptxWSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
 
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya HalderCustom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
 
Demystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyDemystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John Staveley
 
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomSalesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
 
Enterprise Security Monitoring, And Log Management.
Enterprise Security Monitoring, And Log Management.Enterprise Security Monitoring, And Log Management.
Enterprise Security Monitoring, And Log Management.
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
A Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System StrategyA Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System Strategy
 
Introduction to Open Source RAG and RAG Evaluation
Introduction to Open Source RAG and RAG EvaluationIntroduction to Open Source RAG and RAG Evaluation
Introduction to Open Source RAG and RAG Evaluation
 
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
 
Designing for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at ComcastDesigning for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at Comcast
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджера
 
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
 
What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024
 
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
 
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
AI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří KarpíšekAI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří Karpíšek
 

En vedette

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

En vedette (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

UNIT 5- AWT AND SWING.pdf

  • 1. Page: VDate: lT Evemt Hamdlimq Event: Chamqe in status of am abfec Press a buttom,draq & adrop of moue EVemt Hamdinq (ompoments Evenmts An ewCmt 1s a chanqe in Stufe or m Ob/ect Evemt Sorre Ls m_object fhat qemorates m ewemt Cistemers An object fhat istoms to am evmt A Dstemer. qet motiied when G) evemt Occcrs How are eents hmdled ? O A sends it with the Sounte to me ov more /iste es SOrT Cveny Omre lisfem rere/ves the Nent, the eNomt cwill be processed efrDed o. 7w0 tupeS 01 CYOnts O Low /0vel evonts Repreromt direcf commmicatio pom User e key_presse Telease Fo1owmy re lowjeve! ewemh: 0 CmmpdnentEvemt. FocusE VOm F keyE vemt CodtainerEvemt ) WindowEvemt
  • 2. Page Date: Righ 1velevoms: (o Sematc evon E iCap5u/ates meminq of a_uSer In1ertuce compovemt foliowinq ne hiqh lerel' eWmt OActiomElomd Adjustm etEvemt (scaol)brr ZfomE VCNnt ItemE vem t TentEv emt Evemt ist e 07 Evemt Evemt method Sore
  • 3. TTO Page Date 1mporf jwca, Swimq.* impert /mpo7 (Owa. Gcut. evemt| owa, a wt. Class myevemt extemds JFrm2e J/mp/ememts Achnmtiifem e mYeN Cmt ) WAAKTRbaReaU DRuttor(iaCLALON, TeaiFiet cd 1:neuw Jleatfietd (is) 5ellay0uf(new Flowlayout c)) ddl(b) abebeiady JButfom 90w JButtm ("clic/e "); b.adelActicm listomer (this) add (b);_ SefSie 200,2o0) Sef Vib/e (_frue) Setpetqult ClosedperaiOm JFoame EX TT_ONLa public e void ActIonPetormed(AchenFvew tsetTeat(" Heluo") P.s vmShimq oqs) myevt m 2ew_myevetC)
  • 4. Page Date: aivodeupened class MWind exkord inm Label A1 Mhlind O seldayeAut add add Windeuli his) public NO1d uindou Opened(ndnuend ttseTet winoudoftnad
  • 5. Page V Date Windouwtisten r Clas public class windowerample eatemdJs JFrome implemens Windowlistem er o b j e e t u A t be 2 0 q s t o r c 4 abtornpsneAt. WimdowLIMp/ e ) dddwimdowListemer (this) SetSie 400,400o Setlayout ( mul) SetVishb/e (frue) ps.v.m Stvinq t) oqs windowexamp ie w new window exmple) pubiicvoid windowAciuted (WmdouwEveB e ) S.op." achivafed "); pubiic vord wmdowClosog(WindowEvemt e S.0.p. (" closimq") public voic wmdowDeach vated ( Wim dowEvent e) S 0 p.(" Deact vated");
  • 6. Page Date: Java Adopter Classes Provides deroult implem emtutioon of isteme intortares Lf we /nhomit the adap1or class we will not be force d topovioe /272p/ememtuh m ut au methods or istene 1ntvrtuces. So t Saves ode. Owa. awt.ew Omt/tdapter ListomeTIntertace Wimdo wBdo listem er WImdowPoapt py KeyListemex MtaselUTtene MouseMoionLisfemoY A.dapter Class Keyfdapter Focuststemor Lompom entlistener CntwnertistenY Hieaarhy3oumdslitener public Class CwindowCXOmp/e extermds Thepe Windorwhdapfer windouGKONp/e () JFrme new RPe () 1.addwIn dowlistener e Nirdaurdopdto4) sefize (300,300)ISeflayoui (mulu) sef Visible ( frue) p.s,V, m ( Shinq I qs) CUmdOwOCmpiew New wIndocvCXqYple0
  • 7. Page V Date: public vojd wimdowClosinq(WindowEVon e) S.op ( windocw_clored"). dvantug es Reuseability of classes Makes císes more visibe Omretated closses cm wOr toerher Snme class cm be usedim my Cwaus
  • 8. Page: T Date:I| /17ONYmoUs InnerClass 17mCwa ZmeC/ass without mome Cmly Simqle. object iÍ oeoted J Defn: A claSs thaf hos No manme kmowr as cm momymous /nmer class Used you howe to 0ove7dp a method of tlass /7tetare Cm be ceatecd 1 tw0 waysS O ClasS ( abstoa ct r comTe1e InteÍo Ce_ abstra ct class_pOIOn abstadct yoid eat.() class est P.Sym 51nmqtj_aqS)_ Peoscm N etw peISON t) V0id eat () OvCrTide .0p Nire"): p eat )__
  • 9. Page: Date: L inter tace /nictu ce_eatable void eat c) Class fest eatuble e mew eatoble()_ override pubiic yoic eat C) S.op(Nice" e.eatt
  • 10. Page Date: Jmemy Relat ecd classe JmemBar, TMemu JMenulfem pant of swimq packaqe JMemuBar ttaimsJMemu dbjects J Memu 0b/ect awhem seiectecidiplca DOpop Showimq Cme c more JMemdTfe are COms1auctor Tmemu Bar ( Tmen ) Tm emu Stvmg mame Methods add Tmemu C)_ add ( Compmemt c) dd Compomemt n t imdea add d Stzin S)-Oppend JMenaBar mb: mew J17or7UKr() Imemut: ew TMemu ("_File");_ e 22ew TMenu ("Edit") Jmenultem o : mecw 7Memwl1em["pon .add o)_
  • 11. Page Date: TFile ChooseN Swinq). CJsed to selec a hl, folder by arer Constouctoa Jfie ChoosCr () -User odefault dizectoay TF7e Chooser(SIrinq) - qivn path ThieCh00s File P)-q/te fe as poh Method I show0penDialoq() getSelectecl Frle ) e1Ab solutePath ) TCol-Chods er Used to Create a color chooser dialoq bo so that Us er com serect om COtbr. Constructor (O) Jolorhooser C) ' Osed. to crcate a Color cChoosCr pOmej Cvifh white co/0 /nitially TColor Choosor color initialco lor) OIsed to cyeate a colo choose pmej CWIth Specifred coro initally . Methods O vord addchooserPamet (Absbartlolorhoasfar Pmei) Us ed to add a colochoose prmetto the color hooso O stat1C (olo shocw DIalo q ( Compooomt c Stormq tifie'Color mialCo10r) CsedU to show color choasco dialoq bo
  • 12. Page Date DialoqS Messaqe, Contirmatom)1rp)F TAle Ghooser, JCOlorChoose Dialoq windocw is am /ndepemdem Sabcuim do w to show femPorrY Noe apart hom maun Swlng Most dialoqs poesont C eot _ Cuorn ihq 7o User bu dialo94 C po esomt mbqes, dioectory tres TO Ceate mple dialoqs you Cn ImP appn cwindea USe OptionPome class TWO Othor closses TToloochooser P JHethoaser Supply Stom dad dialoqs Dialo q b0 C M1ode aialog bon (3 modeless didloq box