I'm building a 2d game in Java and I decided to use Canvas on which I would display the images relevant to the current frame. I'm using Canvas because I've heard it is more efficient in terms of time than JPanel. Is it true?
Also, I would like to add some input to the game through key bindings since key listeners could cause focus issues and are lower level construct: keylistener not working after clicking button (see answer). Is there a way to use key bindings with a Canvas? Or I would simply use KeyListener.