disabling JFrame's response to spacebar
How can I get a JFrame to stop responding to the spacebar? I'm programming a video game and I want to use the spacebar for firing. I'm using key binding for all responses to key strokes. I just added the spacebar to my bindKeys() method and it didn't respond the same way the other keys did. I soon realized the reason is because the JFrame seems to have priority over the spacebar and it uses it to activate whichever component has the focus. I have a few buttons and I tested this by pressing tab and then seeing if the spacebar had a different response - and it did. I don't really need the JFrame to respond to the spacebar in this way, so I'm looking for a way to disable its responding to it. Is this possible?