jQuery in Action, 3rd edition
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: 808


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!

BLOG: http://leakfromjavaheap.blogspot.com
Campbell Ritchie

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

Joined: Apr 20, 2009
Posts: 808

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

Joined: May 03, 2008
Posts: 5115

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.
subject: global event listener
It's not a secret anymore!