Damn, I'm sorry.. didn't make that too clear,
You want to add the KeyListener to the Frame. So if your frames is called "mainFrame" then at some point you've got to do mainFrame.addKeyListener(myListener).
Something like (excuse pseduo code, I'm not a decent pooter right now)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| public class MyKeyListener implements KeyListener { public void keyPressed(KeyEvent e) { } public void keyReleased(KeyEvent e) {}
public void keyTyped(KeyEvent e) {} }
public class MyFullScreenFrame extends Frame { public MyFullScreenFrame() { super("Demo 1");
addKeyListener(new MyKeyListener()); } } |
Sorry if its not dead on.. shout if you need more help...
Kev