com.droplets.api.event
Class KeyPressEvent

java.lang.Object
  |
  +--java.util.EventObject
        |
        +--com.droplets.api.event.KeyPressEvent
All Implemented Interfaces:
java.io.Serializable

public class KeyPressEvent
extends java.util.EventObject

This event carries with it a key press, represented as an ASCII character code of the key.

See Also:
Serialized Form

Fields inherited from class java.util.EventObject
source
 
Constructor Summary
KeyPressEvent(Component source, int key)
          Construct the new KeyPressEvent.
 
Method Summary
 int getKey()
           
 Component getSourceComponent()
          Type-safe method to return the source object of this event, since we know it's a Component.
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

KeyPressEvent

public KeyPressEvent(Component source,
                     int key)
Construct the new KeyPressEvent.
Parameters:
source - component which dispatched the event.
key - the ascii code of the key
Method Detail

getSourceComponent

public Component getSourceComponent()
Type-safe method to return the source object of this event, since we know it's a Component.
Returns:
the component on which the action occurred

getKey

public int getKey()
Returns:
the ascii code of the key.


Copyright © Droplets, 2001. All Rights Reserved.