aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes global event listener Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "global event listener" Watch "global event listener" New topic

global event listener

Lucas Smith
Ranch Hand

Joined: Apr 20, 2009
Posts: 804


I know that only the focused component can register events from the keyboard. But I have read that there is a method which can handle every key strokes from the keyboard.

I have JFrame object. I want to register "ctrl + plus" key strokes. Can anyone give me an example of the code? I would really appreciate it!

Campbell Ritchie

Joined: Oct 13, 2005
Posts: 38896
Is this about key listeners any use to you?
Lucas Smith
Ranch Hand

Joined: Apr 20, 2009
Posts: 804

Thanks. I will analyze that and give you a response.
Darryl Burke

Joined: May 03, 2008
Posts: 4546

Also take a look at key bindings and Rob Camick's Global Event Listeners.

luck, db
There are no new questions, but there may be new answers.
It is sorta covered in the JavaRanch Style Guide.
subject: global event listener