|
Looks to me that its simply a problem with the focus.
There are a few fixes, one would involve setting the keyListener on the frame itself, and another would simply be requesting it back. In the ButtonListener, simply add requestFocus(); as the final instruction in the actionPerformed. That will pass it back to the SnakePanel.
|