I have such a class KeyListener but when you want to compile a program in this class gives me an error:
Error: can not find symbol
class MyKeyListener implements KeyListener{
Program applet;
MyButton button;
MyKeyListener(Program applet, MyButton button){
this.applet = applet;
this.button = button;
}
public void keyPressed(KeyEvent e) {
if (e.getKeyCode() == e.VK_0) {
button.doClick();
}
}
public void keyReleased(KeyEvent e) {}
public void keyTyped(KeyEvent e) {}
}