Your SlideShare is downloading. ×
  • Like
Lecture 18
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Now you can save presentations on your phone or tablet

Available for both IPhone and Android

Text the download link to your phone

Standard text messaging rates apply

Lecture 18

  • 165 views
Published

Notes on core java

Notes on core java

Published in Technology , Education
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
165
On SlideShare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
13
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 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…