Answered
Recognizing key presses without a mouse click
My program beings with a frame with a "play" button on it.
Once he "play" button is clicked the user is taken to the second
frame to play a game. Control for the game is done via key presses.
The control works well; I'm able to move the sprites and so forth.
However, my problem is after the user clicks "play" and is taken to
the second frame the game will not recognize key presses until the
user has clicked the applet again. How do I get the game to
recognize key presses automatically after the user has clicked
"play"?
Here is the code I use in the second frame to listen for key presses:
Here is the code I use in the second frame to listen for key presses:
