Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

The title basically says it all.

The only thing to take into consideration is it needs to be cross platform.

share|improve this question
What about the java core libraries? – rtheunissen Apr 25 '12 at 12:46

While not technically a JAVA library SDL is a C library that I use extensively that does input and much more. It does however have bindings for java and can run on pretty much any platform in existence.

There is JSDL and SDLjava

share|improve this answer

Kind of depends.

Are you using JFrame without a game library or framework?

If so then you want to call the method addKeyListener(ListenerObjectHere) or addMouseListener(ListenerObjectHere) on the JFrame. Then the listeners you just created should Implement KeyListener or MouseListener.

If you're using a game framework it should have a polling system instead of events, which I'm not sure how to get around (Unless you could obtain the JFrame). If this is the case, just check each update (or tick) if a button is pressed.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.