Hi, ashok, KeyEvent is subclass of InputEvent, which in turn is a subclass of ComponentEvent. Every class that is subclass of Component can generate KeyEvent, TextField is no exception.
It can also generate MouseEvent, which is also a subclass of InputEvent.
Hope it helps.
------------------
Guoqiao Sun
Sun Certified Programmer for
Java 2 Platform
Try my mock exam¹ at
my homepage.
Guoqiao Sun<br />SCJP2 SCWCD2<br />Creator of <a href="http://www.jiris.com/" target="_blank" rel="nofollow">www.jiris.com</a>, Java resource, mock exam, forum