SlideShare uma empresa Scribd logo
1 de 4
Baixar para ler offline
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…

Mais conteúdo relacionado

Mais procurados

Mais procurados (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
 

Destaque

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
 

Destaque (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)
 

Semelhante a 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
 

Semelhante a 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
 

Mais de 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
 

Último

Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 

Último (20)

Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 

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…