When I am using JFrame
and I have a JPanel
and some other component (like a JButton
), I assign the wasd keys to the JFrame(KeyEvent)
, but the JPanel
doesn't respond when I press a key.
Only when the JPanel
is the only component in the JFrame
will the JPanel
respond to Key Events. How can I change this focus so that the JFrame
sends Key Events to the JPanel
.