SlideShare ist ein Scribd-Unternehmen logo
1 von 4
Downloaden Sie, um offline zu lesen
Core Java

Debasish Pratihari

Event Handling :


Event : An event describe in sufficient details, a
particular user action



Instead the program takes care of collecting the
event, the java run-time notifies the program
about the event.



Program that handles user action in this fashion
is called event-driven programming.

System View of Event Handling

Key Strokes, Mouse Actions

Operating System

Java Run-Time

Event
Handlers

Lecture/core/event/18

Event
Handlers

Event
Handlers

Page #1

Event
Handlers

feel the Technology…
Core Java

Debasish Pratihari

Event Types


Low-level Events
o These are events that are arises from the
keyboard or from mouse.



Semantic Events
o These are specific component-related
events

Low –level Event :
Event

Description

FocusEvent

MouseEvent

KeyEvent
WindowEvent
ComponenetEvent
ContainerEvent

Generated when a component gets or loses
input focus.
Generated when the mouse is dragged,
moved, clicked, pressed or released ; also
generated when the mouse enters or exits
a component.
Generated when input is received from the
keyboard.
Generated when a window is activated,
closed, deactivated, deiconified, iconified,
opened or quit.
Generated when a component is hidden,
moved, resized, or became visible.
Generated when a component is added to
or removed from a container.

Relationship Among classes
EventObject

java.util

AWTEvent

java.awt

ContainerEvent

ComponentEvent
WindowEvent

MouseEvent

Lecture/core/event/18

InputEvent

FocusEvent

KeyEvent

Page #2

feel the Technology…
Core Java

Debasish Pratihari

Semantic Events :

Event

ActionEvent

ItemEvent
AdjustEvent

Description

Generated when a button is pressed, a
list item is double-clicked, or a menu
item is selected.
Generated when a check box or list item
is clicked, choice selection is made or a
checkable menu item is selected or
deselected.
Generated on actions on a scrollbar.

Relationship among classes :
EventObject

AWTEvent

ActionEvent

ItemEvent

java.util

java.awt

TextEvent

AdjustmentObject

Listener Interfaces and their Methods:



ActionListener interface:
public abstract void actionPerformed(ActionEvent

e)

AdjustmentListener interface:
public abstract void adjustmentValueChanged(AdjustmentEvent e)





FocusListener interface:
public abstract void focusGained(FocusEvent e)
public abstract void focusLost(FocusEvent e)
ItemListener interface:

public abstract void itemStateChanged(ItemEvent e)

Lecture/core/event/18

Page #3

feel the Technology…
Core Java


Debasish Pratihari

KeyListener interface:

public abstract void keyPressed(KeyEvent e)
public abstract void keyReleased(KeyEvent e)
public abstract void keyTyped(KeyEvent e)


MouseListener interface:

public abstract void mouseClicked(MouseEvent e)
public abstract void mouseEntered(MouseEvent e)
public abstract void mouseExited(MouseEvent e)
public abstract void mousePressed(MouseEvent e)
public abstract void mouseReleased(MouseEvent e)


MouseMotionListener interface

public abstract void mouseDragged(MouseMotionEvent e)
public abstract void mouseMoved(MouseMotionEvent e)



WindowListener interface:

25%
public abstract void windowActivated(WindowEvent
public
public
public
public
public
public



abstract
abstract
abstract
abstract
abstract
abstract

void
void
void
void
void
void

e)
windowClosed(WindowEvent e)
windowClosing(WindowEvent e)
windowDeactivated(WindowEvent e)
windowDeiconified(WindowEvent e)
windowIconified(WindowEvent e)
windowOpened(WindowEvent e)

TextListener interface:

public abstract void textValueChanged(TextEvent


e)

ComponentListener interface:

public abstract void componentHidden(ComponentEvent e)
public abstract void componentMoved(ComponentEvent e)
public abstract void componentResizes(ComponentEvent e)
public abstract void componentShown(ComponentEvent e)


ContainerListener interface:

public abstract void componentAdded(ContainerEvent e)
public abstract void componentRemoved(ContainerEvent e)

Lecture/core/event/18

Page #4

feel the Technology…

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (17)

Event handling
Event handlingEvent handling
Event handling
 
What is Event
What is EventWhat is Event
What is Event
 
Event handling63
Event handling63Event handling63
Event handling63
 
JAVA GUI PART III
JAVA GUI PART IIIJAVA GUI PART III
JAVA GUI PART III
 
Event Handling in JAVA
Event Handling in JAVAEvent Handling in JAVA
Event Handling in JAVA
 
Event Handling in java
Event Handling in javaEvent Handling in java
Event Handling in java
 
Advance Java Programming(CM5I) Event handling
Advance Java Programming(CM5I) Event handlingAdvance Java Programming(CM5I) Event handling
Advance Java Programming(CM5I) Event handling
 
Event handling
Event handlingEvent handling
Event handling
 
Lecture8 oopj
Lecture8 oopjLecture8 oopj
Lecture8 oopj
 
Android UI Fundamentals part 1
Android UI Fundamentals part 1Android UI Fundamentals part 1
Android UI Fundamentals part 1
 
Intents in Android
Intents in AndroidIntents in Android
Intents in Android
 
Dr Jammi Ashok - Introduction to Java Material (OOPs)
 Dr Jammi Ashok - Introduction to Java Material (OOPs) Dr Jammi Ashok - Introduction to Java Material (OOPs)
Dr Jammi Ashok - Introduction to Java Material (OOPs)
 
Android components
Android componentsAndroid components
Android components
 
Android activity lifecycle
Android activity lifecycleAndroid activity lifecycle
Android activity lifecycle
 
Android apps development
Android apps developmentAndroid apps development
Android apps development
 
Ppt 2 android_basics
Ppt 2 android_basicsPpt 2 android_basics
Ppt 2 android_basics
 
04 activities - Android
04   activities - Android04   activities - Android
04 activities - Android
 

Andere mochten auch

Learning Pool Social Care Webinar Presentation
Learning Pool Social Care Webinar PresentationLearning Pool Social Care Webinar Presentation
Learning Pool Social Care Webinar PresentationPaul McElvaney
 
Fip lezing Istanbul deel 3
Fip lezing Istanbul deel 3Fip lezing Istanbul deel 3
Fip lezing Istanbul deel 3Sjef Kerkhofs
 
Scenario exercise 2014 mid atlantic technical communication conference DDeBoard
Scenario exercise 2014 mid atlantic technical communication conference DDeBoardScenario exercise 2014 mid atlantic technical communication conference DDeBoard
Scenario exercise 2014 mid atlantic technical communication conference DDeBoardddeboard
 
Worksheet
WorksheetWorksheet
WorksheetNg Lim
 
Workshop logeion 1004 webversie
Workshop logeion 1004 webversieWorkshop logeion 1004 webversie
Workshop logeion 1004 webversieSjef Kerkhofs
 
Hari
HariHari
Harislomb
 
产品思考
产品思考产品思考
产品思考yamingd
 
Ucapan gb
Ucapan gbUcapan gb
Ucapan gbslomb
 
Learning pool community rewards
Learning pool community rewardsLearning pool community rewards
Learning pool community rewardsPaul McElvaney
 
Codemotion 2012 : Sphinx: Open Source Search Server
Codemotion 2012 : Sphinx: Open Source Search ServerCodemotion 2012 : Sphinx: Open Source Search Server
Codemotion 2012 : Sphinx: Open Source Search ServerMatteo Baccan
 
纖維 Revision
纖維 Revision纖維 Revision
纖維 RevisionNg Lim
 
Continuous Deployment at Disqus (Pylons Minicon)
Continuous Deployment at Disqus (Pylons Minicon)Continuous Deployment at Disqus (Pylons Minicon)
Continuous Deployment at Disqus (Pylons Minicon)zeeg
 

Andere mochten auch (20)

Learning Pool Social Care Webinar Presentation
Learning Pool Social Care Webinar PresentationLearning Pool Social Care Webinar Presentation
Learning Pool Social Care Webinar Presentation
 
Fip lezing Istanbul deel 3
Fip lezing Istanbul deel 3Fip lezing Istanbul deel 3
Fip lezing Istanbul deel 3
 
Scenario exercise 2014 mid atlantic technical communication conference DDeBoard
Scenario exercise 2014 mid atlantic technical communication conference DDeBoardScenario exercise 2014 mid atlantic technical communication conference DDeBoard
Scenario exercise 2014 mid atlantic technical communication conference DDeBoard
 
Worksheet
WorksheetWorksheet
Worksheet
 
The Big Bang of the Internet of Things
The Big Bang of the Internet of ThingsThe Big Bang of the Internet of Things
The Big Bang of the Internet of Things
 
Workshop logeion 1004 webversie
Workshop logeion 1004 webversieWorkshop logeion 1004 webversie
Workshop logeion 1004 webversie
 
Convtracking jan05
Convtracking jan05Convtracking jan05
Convtracking jan05
 
Lecture 22
Lecture 22Lecture 22
Lecture 22
 
Lecture 16
Lecture 16Lecture 16
Lecture 16
 
Lecture 3
Lecture 3Lecture 3
Lecture 3
 
Hari
HariHari
Hari
 
Reed business preso
Reed business presoReed business preso
Reed business preso
 
Editing
EditingEditing
Editing
 
产品思考
产品思考产品思考
产品思考
 
Ucapan gb
Ucapan gbUcapan gb
Ucapan gb
 
Learning pool community rewards
Learning pool community rewardsLearning pool community rewards
Learning pool community rewards
 
Codemotion 2012 : Sphinx: Open Source Search Server
Codemotion 2012 : Sphinx: Open Source Search ServerCodemotion 2012 : Sphinx: Open Source Search Server
Codemotion 2012 : Sphinx: Open Source Search Server
 
Para Que Serve O Galego
Para Que Serve O GalegoPara Que Serve O Galego
Para Que Serve O Galego
 
纖維 Revision
纖維 Revision纖維 Revision
纖維 Revision
 
Continuous Deployment at Disqus (Pylons Minicon)
Continuous Deployment at Disqus (Pylons Minicon)Continuous Deployment at Disqus (Pylons Minicon)
Continuous Deployment at Disqus (Pylons Minicon)
 

Ähnlich wie Lecture 18

engineeringdsgtnotesofunitfivesnists.ppt
engineeringdsgtnotesofunitfivesnists.pptengineeringdsgtnotesofunitfivesnists.ppt
engineeringdsgtnotesofunitfivesnists.pptsharanyak0721
 
Java session11
Java session11Java session11
Java session11Niit Care
 
ITE 1122_ Event Handling.pptx
ITE 1122_ Event Handling.pptxITE 1122_ Event Handling.pptx
ITE 1122_ Event Handling.pptxudithaisur
 
event-handling.pptx
event-handling.pptxevent-handling.pptx
event-handling.pptxusvirat1805
 
Event handling62
Event handling62Event handling62
Event handling62myrajendra
 
How to use Listener Class in Flutter.pptx
How to use Listener Class in Flutter.pptxHow to use Listener Class in Flutter.pptx
How to use Listener Class in Flutter.pptxFlutter Agency
 
ACtionlistener in java use in discussion.pptx
ACtionlistener in java use in discussion.pptxACtionlistener in java use in discussion.pptx
ACtionlistener in java use in discussion.pptxMattFlordeliza1
 
event handling new.ppt
event handling new.pptevent handling new.ppt
event handling new.pptusama537223
 
Java Abstract Window Toolkit (AWT) Presentation. 2024
Java Abstract Window Toolkit (AWT) Presentation. 2024Java Abstract Window Toolkit (AWT) Presentation. 2024
Java Abstract Window Toolkit (AWT) Presentation. 2024nehakumari0xf
 
Java Abstract Window Toolkit (AWT) Presentation. 2024
Java Abstract Window Toolkit (AWT) Presentation. 2024Java Abstract Window Toolkit (AWT) Presentation. 2024
Java Abstract Window Toolkit (AWT) Presentation. 2024kashyapneha2809
 
Advance java for bscit
Advance java for bscitAdvance java for bscit
Advance java for bscitYogeshDhamke2
 

Ähnlich wie Lecture 18 (20)

Unit 6 Java
Unit 6 JavaUnit 6 Java
Unit 6 Java
 
engineeringdsgtnotesofunitfivesnists.ppt
engineeringdsgtnotesofunitfivesnists.pptengineeringdsgtnotesofunitfivesnists.ppt
engineeringdsgtnotesofunitfivesnists.ppt
 
Java session11
Java session11Java session11
Java session11
 
ITE 1122_ Event Handling.pptx
ITE 1122_ Event Handling.pptxITE 1122_ Event Handling.pptx
ITE 1122_ Event Handling.pptx
 
09events
09events09events
09events
 
event-handling.pptx
event-handling.pptxevent-handling.pptx
event-handling.pptx
 
JAVA PROGRAMMING- GUI Programming with Swing - The Swing Buttons
JAVA PROGRAMMING- GUI Programming with Swing - The Swing ButtonsJAVA PROGRAMMING- GUI Programming with Swing - The Swing Buttons
JAVA PROGRAMMING- GUI Programming with Swing - The Swing Buttons
 
Event handling62
Event handling62Event handling62
Event handling62
 
How to use Listener Class in Flutter.pptx
How to use Listener Class in Flutter.pptxHow to use Listener Class in Flutter.pptx
How to use Listener Class in Flutter.pptx
 
Gu iintro(java)
Gu iintro(java)Gu iintro(java)
Gu iintro(java)
 
ACtionlistener in java use in discussion.pptx
ACtionlistener in java use in discussion.pptxACtionlistener in java use in discussion.pptx
ACtionlistener in java use in discussion.pptx
 
event handling new.ppt
event handling new.pptevent handling new.ppt
event handling new.ppt
 
JAVA AWT
JAVA AWTJAVA AWT
JAVA AWT
 
Java Abstract Window Toolkit (AWT) Presentation. 2024
Java Abstract Window Toolkit (AWT) Presentation. 2024Java Abstract Window Toolkit (AWT) Presentation. 2024
Java Abstract Window Toolkit (AWT) Presentation. 2024
 
Java Abstract Window Toolkit (AWT) Presentation. 2024
Java Abstract Window Toolkit (AWT) Presentation. 2024Java Abstract Window Toolkit (AWT) Presentation. 2024
Java Abstract Window Toolkit (AWT) Presentation. 2024
 
Jp notes
Jp notesJp notes
Jp notes
 
JAVA (UNIT 5)
JAVA (UNIT 5)JAVA (UNIT 5)
JAVA (UNIT 5)
 
Advance java for bscit
Advance java for bscitAdvance java for bscit
Advance java for bscit
 
Event handling
Event handlingEvent handling
Event handling
 
Event handling
Event handlingEvent handling
Event handling
 

Mehr von Debasish Pratihari (17)

Lecture 24
Lecture 24Lecture 24
Lecture 24
 
Lecture 23
Lecture 23Lecture 23
Lecture 23
 
Lecture 21
Lecture 21Lecture 21
Lecture 21
 
Lecture 20
Lecture 20Lecture 20
Lecture 20
 
Lecture 19
Lecture 19Lecture 19
Lecture 19
 
Lecture 17
Lecture 17Lecture 17
Lecture 17
 
Lecture 14
Lecture 14Lecture 14
Lecture 14
 
Lecture 10
Lecture 10Lecture 10
Lecture 10
 
Lecture 9
Lecture 9Lecture 9
Lecture 9
 
Lecture 8
Lecture 8Lecture 8
Lecture 8
 
Lecture 7
Lecture 7Lecture 7
Lecture 7
 
Lecture 6
Lecture 6Lecture 6
Lecture 6
 
Lecture 5
Lecture 5Lecture 5
Lecture 5
 
Lecture 4
Lecture 4Lecture 4
Lecture 4
 
Lecture 2
Lecture 2Lecture 2
Lecture 2
 
Lecture 1
Lecture 1Lecture 1
Lecture 1
 
Lecture25
Lecture25Lecture25
Lecture25
 

Kürzlich hochgeladen

SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 

Kürzlich hochgeladen (20)

SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 

Lecture 18

  • 1. Core Java Debasish Pratihari Event Handling :  Event : An event describe in sufficient details, a particular user action  Instead the program takes care of collecting the event, the java run-time notifies the program about the event.  Program that handles user action in this fashion is called event-driven programming. System View of Event Handling Key Strokes, Mouse Actions Operating System Java Run-Time Event Handlers Lecture/core/event/18 Event Handlers Event Handlers Page #1 Event Handlers feel the Technology…
  • 2. Core Java Debasish Pratihari Event Types  Low-level Events o These are events that are arises from the keyboard or from mouse.  Semantic Events o These are specific component-related events Low –level Event : Event Description FocusEvent MouseEvent KeyEvent WindowEvent ComponenetEvent ContainerEvent Generated when a component gets or loses input focus. Generated when the mouse is dragged, moved, clicked, pressed or released ; also generated when the mouse enters or exits a component. Generated when input is received from the keyboard. Generated when a window is activated, closed, deactivated, deiconified, iconified, opened or quit. Generated when a component is hidden, moved, resized, or became visible. Generated when a component is added to or removed from a container. Relationship Among classes EventObject java.util AWTEvent java.awt ContainerEvent ComponentEvent WindowEvent MouseEvent Lecture/core/event/18 InputEvent FocusEvent KeyEvent Page #2 feel the Technology…
  • 3. Core Java Debasish Pratihari Semantic Events : Event ActionEvent ItemEvent AdjustEvent Description Generated when a button is pressed, a list item is double-clicked, or a menu item is selected. Generated when a check box or list item is clicked, choice selection is made or a checkable menu item is selected or deselected. Generated on actions on a scrollbar. Relationship among classes : EventObject AWTEvent ActionEvent ItemEvent java.util java.awt TextEvent AdjustmentObject Listener Interfaces and their Methods:   ActionListener interface: public abstract void actionPerformed(ActionEvent e) AdjustmentListener interface: public abstract void adjustmentValueChanged(AdjustmentEvent e)   FocusListener interface: public abstract void focusGained(FocusEvent e) public abstract void focusLost(FocusEvent e) ItemListener interface: public abstract void itemStateChanged(ItemEvent e) Lecture/core/event/18 Page #3 feel the Technology…
  • 4. Core Java  Debasish Pratihari KeyListener interface: public abstract void keyPressed(KeyEvent e) public abstract void keyReleased(KeyEvent e) public abstract void keyTyped(KeyEvent e)  MouseListener interface: public abstract void mouseClicked(MouseEvent e) public abstract void mouseEntered(MouseEvent e) public abstract void mouseExited(MouseEvent e) public abstract void mousePressed(MouseEvent e) public abstract void mouseReleased(MouseEvent e)  MouseMotionListener interface public abstract void mouseDragged(MouseMotionEvent e) public abstract void mouseMoved(MouseMotionEvent e)  WindowListener interface: 25% public abstract void windowActivated(WindowEvent public public public public public public  abstract abstract abstract abstract abstract abstract void void void void void void e) windowClosed(WindowEvent e) windowClosing(WindowEvent e) windowDeactivated(WindowEvent e) windowDeiconified(WindowEvent e) windowIconified(WindowEvent e) windowOpened(WindowEvent e) TextListener interface: public abstract void textValueChanged(TextEvent  e) ComponentListener interface: public abstract void componentHidden(ComponentEvent e) public abstract void componentMoved(ComponentEvent e) public abstract void componentResizes(ComponentEvent e) public abstract void componentShown(ComponentEvent e)  ContainerListener interface: public abstract void componentAdded(ContainerEvent e) public abstract void componentRemoved(ContainerEvent e) Lecture/core/event/18 Page #4 feel the Technology…