This preview shows page 1. Sign up to view the full content.
Unformatted text preview: object, which provides more data about event, such as the location of mouse. • General steps: 1. init or run method should call addMouseListeners 2. Write definitions of any listener methods needed Using portions of slides by Eric Roberts Responding to Keyboard Events keyPressed( e ) keyReleased( e ) keyTyped( e ) Called when the user presses a key Called when the key comes back up Called when the user types (presses and releases) a key The parameter e is a KeyEvent object, which indicates which key is involved. • General steps: 1. init or run method should call addKeyListeners 2. Write definitions of any listener methods needed Using portions of slides by Eric Roberts MouseTracker Example...
View Full Document
This note was uploaded on 02/18/2010 for the course CS 106A taught by Professor Sahami,m during the Fall '08 term at Stanford.
- Fall '08