I am trying to make a game engine. I have made the Game class but the error resides in the KeyBoard class. Here I leave some code.
Class:: Game
You can add the key listener to the JFrame, that's something I've done in the past. It's probably not a good idea however if you have other components in the JFrame.