Did you follow Norm's link and did you have a look at the tutorial? It explains a lot on how to use a KeyListener.
Type: Posts; User: OutputStream
Did you follow Norm's link and did you have a look at the tutorial? It explains a lot on how to use a KeyListener.
if(key=='1')
You are comparing an int to a char. Remove the single-quotes and compare key to an int instead.
Also what error message are you getting?
EDIT: keyDown is a deprecated method. I...