Hi, My KeyListner is not working for my JFrame and JPanel and I can’t work out why.
I am using the exact code that has worked for me before
Please help!
Here is the JFrame
public Display() {
setSize(640, 480);
setTitle("Ludum Dare 23: ");
setVisible(true);
setResizable(false);
setDefaultCloseOperation(EXIT_ON_CLOSE);
setLocationRelativeTo(null);
createBufferStrategy(2);
Game game = new Game(this.getBufferStrategy());
setFocusable(true);
addKeyListener(new InputManager());
add(game);
}
Max