How to implement mouse and key listener in one class

Hi all,

I am new to Java and would like to know how to implement mouse and key listener in one class. I am trying to create an applet that behaves a certian way when a mouse is clicked and behaves another way when a certain key is pressed.

I can implement one or the other, I dont know how to implement both.

Thanks in advance.

Haresh.

[373 byte] By [hareshkc] at [2007-9-26 1:25:29]
# 1
"public class Foo extends Applet implements MouseListener, KeyListener" and implement all the needed methods.
jsalonen at 2007-6-29 1:07:03 > top of Java-index,Archived Forums,New To Java Technology Archive...
# 2
Thanks a bunch.Haresh.
hareshkc at 2007-6-29 1:07:03 > top of Java-index,Archived Forums,New To Java Technology Archive...