SlideShare une entreprise Scribd logo
1  sur  23
By
Shraddha Sheth
Neel Shah
o The Event Handling Process
o Event Classes
o Semantic Event Handling in Applets
o Semantic Event Handling in an Application

enableEvents(WINDOW_EVENT_MASK | MOUSE_EVENT_MASK);
Go
WINDOW_OPENED
 The event that occurs the first time a window is made
visible.
WINDOW_CLOSING
 The event that occurs as a result of the close icon being
selected or Close being selected from the window’s system
menu.
WINDOW_CLOSED
 The event that occurs when the window has been closed.
WINDOW_ACTIVATED
 The event that occurs when the window is activated—
obtains the focus, in other words. When another GUI
component has the focus,you could make the window obtain
the focus by clicking on it, for
WINDOW_DEACTIVATED
 The event that occurs when the window is deactivated—loses the
focus, in other words. Clicking on another window would cause this
event.
WINDOW_GAINED_FOCUS
 The event that occurs when the window gains the focus. This implies
that the window or one of its components will receive keyboard
events.
WINDOW_LOST_FOCUS
 The event that occurs when the window loses the focus. This implies
that keyboard events will not be delivered to the window or any of
its components.
WINDOW_ICONIFIED
 The event that occurs when the window is minimized and reduced
to an icon.
WINDOW_DEICONIFIED
 The event that occurs when the window is restored from an icon.
WINDOW_STATE_CHANGED
 The event that occurs when the window state changes—when it
ismaximized or minimized, for instance.
processWindowFocusEvent(WindowEvent e)
This method is called for any window focus
events that arise as long as such events are
enabled for the window.
processWindowStateEvent(WindowEvent e)
This method is called for events arising as a
result of the window changing state.
processEvent(AWTEvent e)
This method is called first for any events that are enabled
for the component. If you implement this method and
fail to call the base class method, none of the methods
for specific groups of events will be called.
processFocusEvent(FocusEvent e)
 This method will be called for focus events, if they are
enabled for the component.
processKeyEvent(KeyEvent e)
This method will be called for key events, if they are
enabled for the component.
processMouseEvent(MouseEvent e)
This method will be called for mouse button events, if
they are enabled for the component.
processMouseMotionEvent(MouseEvent e)
This method will be called for mouse move and drag
events, if they are enabled for the component.
processMouseWheelEvent(MouseWheelEvent e)
This method will be called for mouse wheel rotation
events, if they are enabled for the component
The WindowListener Interface
The WindowFocusListener Interface
The WindowStateListener Interface
The MouseListener Interface
The MouseMotionListener Interface
The MouseWheelListener Interface
The KeyListener Interface
The FocusListener Interface
windowGainedFocus(WindowEvent e)
 Called when the window gains the focus such that the
window or one of its components will receive keyboard
events.
windowLostFocus(WindowEvent e)
Called when the window loses the focus. After this
event, neither the window nor any of its components
will receive keyboard events.
The WindowStateListener Interface
windowStateChanged(WindowEvent e)
Called when the window state changes—when it is
maximized or iconified.
The MouseMotionListener Interface
mouseMoved(MouseEvent e)
 Called when the mouse is moved within a component
mouseDragged(MouseEvent e)
 Called when the mouse is moved within a component
while a mouse button is held down
The MouseWheelListener Interface
mouseWheelMoved(MouseWheelEvent e)
Called when the mouse wheel is rotated
Go
The KeyListener Interface
This interface defines methods to respond to events
arising when a key on the keyboard is pressed or released.
keyTyped(KeyEvent e)
 Called when a key on the keyboard is pressed and then
released
keyPressed(KeyEvent e)
 Called when a key on the keyboard is pressed
keyReleased(KeyEvent e)
 Called when a key on the keyboard is released
The FocusListener Interface
This interface defines methods to respond to a component
gaining or losing the focus.
focusGained(FocusEvent e)
 Called when a component gains the keyboard focus
focusLost(FocusEvent e)
 Called when a component loses the keyboard focus Go
FocusAdapter
WindowAdapter
KeyAdapter
MouseAdapter
MouseMotionAdapter
MouseInputAdapter
Go
Semantic Event Listeners
ActionListener
void actionPerformed(ActionEvent e)
ItemListener
void itemStateChanged(ItemEvent e)
AdjustmentListener
void adjustmentValueChanged(AdjustmentEvent e)
Go
Example

Contenu connexe

Tendances

Unit-3 event handling
Unit-3 event handlingUnit-3 event handling
Unit-3 event handlingAmol Gaikwad
 
Advance Java Programming(CM5I) Event handling
Advance Java Programming(CM5I) Event handlingAdvance Java Programming(CM5I) Event handling
Advance Java Programming(CM5I) Event handlingPayal Dungarwal
 
Event handling63
Event handling63Event handling63
Event handling63myrajendra
 
Event handling
Event handlingEvent handling
Event handlingswapnac12
 
JAVA GUI PART III
JAVA GUI PART IIIJAVA GUI PART III
JAVA GUI PART IIIOXUS 20
 
Ajp notes-chapter-03
Ajp notes-chapter-03Ajp notes-chapter-03
Ajp notes-chapter-03Ankit Dubey
 
12 High Level UI Event Handling
12 High Level UI Event Handling12 High Level UI Event Handling
12 High Level UI Event Handlingcorneliuskoo
 
Chapter 11.5
Chapter 11.5Chapter 11.5
Chapter 11.5sotlsoc
 
Java gui event
Java gui eventJava gui event
Java gui eventSoftNutx
 
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)jammiashok123
 
Lesson 07 Actions and Commands in WPF
Lesson 07 Actions and Commands in WPFLesson 07 Actions and Commands in WPF
Lesson 07 Actions and Commands in WPFQuang Nguyễn Bá
 
Graphical User Interface (GUI) - 2
Graphical User Interface (GUI) - 2Graphical User Interface (GUI) - 2
Graphical User Interface (GUI) - 2PRN USM
 
Advance Java Programming (CM5I) 2.Swing
Advance Java Programming (CM5I) 2.SwingAdvance Java Programming (CM5I) 2.Swing
Advance Java Programming (CM5I) 2.SwingPayal Dungarwal
 

Tendances (20)

Unit-3 event handling
Unit-3 event handlingUnit-3 event handling
Unit-3 event handling
 
Event handling
Event handlingEvent handling
Event handling
 
Advance Java Programming(CM5I) Event handling
Advance Java Programming(CM5I) Event handlingAdvance Java Programming(CM5I) Event handling
Advance Java Programming(CM5I) Event handling
 
Event handling63
Event handling63Event handling63
Event handling63
 
Event handling
Event handlingEvent handling
Event handling
 
What is Event
What is EventWhat is Event
What is Event
 
JAVA GUI PART III
JAVA GUI PART IIIJAVA GUI PART III
JAVA GUI PART III
 
Ajp notes-chapter-03
Ajp notes-chapter-03Ajp notes-chapter-03
Ajp notes-chapter-03
 
Swing
SwingSwing
Swing
 
Lecture8 oopj
Lecture8 oopjLecture8 oopj
Lecture8 oopj
 
12 High Level UI Event Handling
12 High Level UI Event Handling12 High Level UI Event Handling
12 High Level UI Event Handling
 
Chapter 11.5
Chapter 11.5Chapter 11.5
Chapter 11.5
 
Java gui event
Java gui eventJava gui event
Java gui event
 
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)
 
Lesson 07 Actions and Commands in WPF
Lesson 07 Actions and Commands in WPFLesson 07 Actions and Commands in WPF
Lesson 07 Actions and Commands in WPF
 
Graphical User Interface (GUI) - 2
Graphical User Interface (GUI) - 2Graphical User Interface (GUI) - 2
Graphical User Interface (GUI) - 2
 
Java: GUI
Java: GUIJava: GUI
Java: GUI
 
09events
09events09events
09events
 
25 awt
25 awt25 awt
25 awt
 
Advance Java Programming (CM5I) 2.Swing
Advance Java Programming (CM5I) 2.SwingAdvance Java Programming (CM5I) 2.Swing
Advance Java Programming (CM5I) 2.Swing
 

En vedette (7)

Java programming-Event Handling
Java programming-Event HandlingJava programming-Event Handling
Java programming-Event Handling
 
Awt
AwtAwt
Awt
 
Java awt
Java awtJava awt
Java awt
 
00 swing
00 swing00 swing
00 swing
 
Java session11
Java session11Java session11
Java session11
 
Java AWT
Java AWTJava AWT
Java AWT
 
Applet life cycle
Applet life cycleApplet life cycle
Applet life cycle
 

Similaire à Java Event Handling

engineeringdsgtnotesofunitfivesnists.ppt
engineeringdsgtnotesofunitfivesnists.pptengineeringdsgtnotesofunitfivesnists.ppt
engineeringdsgtnotesofunitfivesnists.pptsharanyak0721
 
event-handling.pptx
event-handling.pptxevent-handling.pptx
event-handling.pptxGood657694
 
Mobile Application Development
Mobile Application DevelopmentMobile Application Development
Mobile Application DevelopmentMuhammad Sajid
 
Yahoo presentation: JavaScript Events
Yahoo presentation: JavaScript EventsYahoo presentation: JavaScript Events
Yahoo presentation: JavaScript EventsPeter-Paul Koch
 
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
 
ITE 1122_ Event Handling.pptx
ITE 1122_ Event Handling.pptxITE 1122_ Event Handling.pptx
ITE 1122_ Event Handling.pptxudithaisur
 
java Unit4 chapter1 applets
java Unit4 chapter1 appletsjava Unit4 chapter1 applets
java Unit4 chapter1 appletsraksharao
 
FirefoxOS Window Management
FirefoxOS Window ManagementFirefoxOS Window Management
FirefoxOS Window ManagementAlive Kuo
 
JEDI Slides-Intro2-Chapter20-GUI Event Handling.pdf
JEDI Slides-Intro2-Chapter20-GUI Event Handling.pdfJEDI Slides-Intro2-Chapter20-GUI Event Handling.pdf
JEDI Slides-Intro2-Chapter20-GUI Event Handling.pdfMarlouFelixIIICunana
 
File Handling
File HandlingFile Handling
File HandlingSohanur63
 
Advance java for bscit
Advance java for bscitAdvance java for bscit
Advance java for bscitYogeshDhamke2
 
Voices That Matter: JavaScript Events
Voices That Matter: JavaScript EventsVoices That Matter: JavaScript Events
Voices That Matter: JavaScript EventsPeter-Paul Koch
 

Similaire à Java Event Handling (20)

engineeringdsgtnotesofunitfivesnists.ppt
engineeringdsgtnotesofunitfivesnists.pptengineeringdsgtnotesofunitfivesnists.ppt
engineeringdsgtnotesofunitfivesnists.ppt
 
JAVA AWT
JAVA AWTJAVA AWT
JAVA AWT
 
event-handling.pptx
event-handling.pptxevent-handling.pptx
event-handling.pptx
 
Mobile Application Development
Mobile Application DevelopmentMobile Application Development
Mobile Application Development
 
Java
JavaJava
Java
 
AWT
AWT AWT
AWT
 
Yahoo presentation: JavaScript Events
Yahoo presentation: JavaScript EventsYahoo presentation: JavaScript Events
Yahoo presentation: JavaScript Events
 
event handling new.ppt
event handling new.pptevent handling new.ppt
event handling new.ppt
 
Lecture 18
Lecture 18Lecture 18
Lecture 18
 
Androd Listeners
Androd ListenersAndrod Listeners
Androd Listeners
 
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
 
ITE 1122_ Event Handling.pptx
ITE 1122_ Event Handling.pptxITE 1122_ Event Handling.pptx
ITE 1122_ Event Handling.pptx
 
java Unit4 chapter1 applets
java Unit4 chapter1 appletsjava Unit4 chapter1 applets
java Unit4 chapter1 applets
 
Unit 6 Java
Unit 6 JavaUnit 6 Java
Unit 6 Java
 
FirefoxOS Window Management
FirefoxOS Window ManagementFirefoxOS Window Management
FirefoxOS Window Management
 
JEDI Slides-Intro2-Chapter20-GUI Event Handling.pdf
JEDI Slides-Intro2-Chapter20-GUI Event Handling.pdfJEDI Slides-Intro2-Chapter20-GUI Event Handling.pdf
JEDI Slides-Intro2-Chapter20-GUI Event Handling.pdf
 
File Handling
File HandlingFile Handling
File Handling
 
Advance java for bscit
Advance java for bscitAdvance java for bscit
Advance java for bscit
 
Voices That Matter: JavaScript Events
Voices That Matter: JavaScript EventsVoices That Matter: JavaScript Events
Voices That Matter: JavaScript Events
 

Dernier

How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 

Dernier (20)

How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 

Java Event Handling

  • 2. o The Event Handling Process o Event Classes o Semantic Event Handling in Applets o Semantic Event Handling in an Application 
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 9. WINDOW_OPENED  The event that occurs the first time a window is made visible. WINDOW_CLOSING  The event that occurs as a result of the close icon being selected or Close being selected from the window’s system menu. WINDOW_CLOSED  The event that occurs when the window has been closed. WINDOW_ACTIVATED  The event that occurs when the window is activated— obtains the focus, in other words. When another GUI component has the focus,you could make the window obtain the focus by clicking on it, for
  • 10. WINDOW_DEACTIVATED  The event that occurs when the window is deactivated—loses the focus, in other words. Clicking on another window would cause this event. WINDOW_GAINED_FOCUS  The event that occurs when the window gains the focus. This implies that the window or one of its components will receive keyboard events. WINDOW_LOST_FOCUS  The event that occurs when the window loses the focus. This implies that keyboard events will not be delivered to the window or any of its components. WINDOW_ICONIFIED  The event that occurs when the window is minimized and reduced to an icon. WINDOW_DEICONIFIED  The event that occurs when the window is restored from an icon. WINDOW_STATE_CHANGED  The event that occurs when the window state changes—when it ismaximized or minimized, for instance.
  • 11. processWindowFocusEvent(WindowEvent e) This method is called for any window focus events that arise as long as such events are enabled for the window. processWindowStateEvent(WindowEvent e) This method is called for events arising as a result of the window changing state.
  • 12. processEvent(AWTEvent e) This method is called first for any events that are enabled for the component. If you implement this method and fail to call the base class method, none of the methods for specific groups of events will be called. processFocusEvent(FocusEvent e)  This method will be called for focus events, if they are enabled for the component. processKeyEvent(KeyEvent e) This method will be called for key events, if they are enabled for the component.
  • 13. processMouseEvent(MouseEvent e) This method will be called for mouse button events, if they are enabled for the component. processMouseMotionEvent(MouseEvent e) This method will be called for mouse move and drag events, if they are enabled for the component. processMouseWheelEvent(MouseWheelEvent e) This method will be called for mouse wheel rotation events, if they are enabled for the component
  • 14. The WindowListener Interface The WindowFocusListener Interface The WindowStateListener Interface The MouseListener Interface The MouseMotionListener Interface The MouseWheelListener Interface The KeyListener Interface The FocusListener Interface
  • 15.
  • 16. windowGainedFocus(WindowEvent e)  Called when the window gains the focus such that the window or one of its components will receive keyboard events. windowLostFocus(WindowEvent e) Called when the window loses the focus. After this event, neither the window nor any of its components will receive keyboard events. The WindowStateListener Interface windowStateChanged(WindowEvent e) Called when the window state changes—when it is maximized or iconified.
  • 17.
  • 18. The MouseMotionListener Interface mouseMoved(MouseEvent e)  Called when the mouse is moved within a component mouseDragged(MouseEvent e)  Called when the mouse is moved within a component while a mouse button is held down The MouseWheelListener Interface mouseWheelMoved(MouseWheelEvent e) Called when the mouse wheel is rotated Go
  • 19. The KeyListener Interface This interface defines methods to respond to events arising when a key on the keyboard is pressed or released. keyTyped(KeyEvent e)  Called when a key on the keyboard is pressed and then released keyPressed(KeyEvent e)  Called when a key on the keyboard is pressed keyReleased(KeyEvent e)  Called when a key on the keyboard is released The FocusListener Interface This interface defines methods to respond to a component gaining or losing the focus. focusGained(FocusEvent e)  Called when a component gains the keyboard focus focusLost(FocusEvent e)  Called when a component loses the keyboard focus Go
  • 21.
  • 22. Semantic Event Listeners ActionListener void actionPerformed(ActionEvent e) ItemListener void itemStateChanged(ItemEvent e) AdjustmentListener void adjustmentValueChanged(AdjustmentEvent e) Go