java - Canvas and InputMap -


i'm building 2d game in java , decided use canvas on display images relevant current frame. i'm using canvas because i've heard more efficient in terms of time jpanel. true?

also, add input game through key bindings since key listeners cause focus issues , lower level construct: keylistener not working after clicking button (see answer). there way use key bindings canvas? or use keylistener.

  • you can't add keybindings awt.canvas, there isn't method implemented in api

  • you can add keylistener

  • change decision , use jpanel/jcomponent


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -