View Single Post
Old 10-02-2012, 11:28 PM   PM User | #3
scottyavh
New to the CF scene

 
Join Date: Oct 2012
Location: New Zealand
Posts: 2
Thanks: 1
Thanked 0 Times in 0 Posts
scottyavh is an unknown quantity at this point
Quote:
Originally Posted by Fou-Lu View Post
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.
Thank you very much Fou-Lou, it works now! I had done a bit of looking around and thought it might be a simple fix but simply don't know enough about focus myself (first time I've come across it). Cheers!
scottyavh is offline   Reply With Quote