Get the tools you need to learn Java skills fast!
Video tutorials, eBooks, hands-on lab exercises, sample code.
Get started
The moose likes Swing / AWT / SWT and the fly likes Any Key Press with KeyListener Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of The Software Craftsman this week in the Agile forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Any Key Press with KeyListener" Watch "Any Key Press with KeyListener" New topic

Any Key Press with KeyListener

Keith Spriggs

Joined: Jul 19, 2012
Posts: 18
Hi guys,
I need a bit of help with this one.

What I want to do is report when key has pressed.

The issue is that do have I have to specify all possible keys individually or is there a method or some code that allows me to do this.

I have a method that needs to send back a string to the user.
Paul Clapham

Joined: Oct 14, 2005
Posts: 19357

Here's a link to the tutorial: How to Write a Key Listener.
Have you tried LearnNowOnline?
subject: Any Key Press with KeyListener