Why doesn't an applet viewed through the browser respond to keyboard events, but the same works fine from within appletviewer?

John Zukowski

In order to respond to keyboard events your applet needs to have the input focus. In the case of appletviewer, there is nothing else on the page that might have focus. In the case of a browser, there is. Just click into the applet's area to have it get the input focus and then it will respond to keyboard events.