As for the fact that KeyListener does not work for JApplet as it does for Applet you should use the KeyEventDispatcher interface.
public class AppletMain extends JApplet implements java.awt.KeyEventDispatcher
Furthermore you have to set the KeyboardFocusManager to the Panel
KeyboardFocusManager.getCurrentKeyboardFocusManager().addKeyEventDispatcher(this);
Afterwards override the dispatchKeyEvent function of the interface:
@Override
public boolean dispatchKeyEvent(KeyEvent e);
This allows you to catch the KeyEvents as it is done with KeyListener.