wood burning stoves*
The moose likes Swing / AWT / SWT and the fly likes catching keyboard events Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "catching keyboard events" Watch "catching keyboard events" New topic
Author

catching keyboard events

paul wheaton
Trailboss

Joined: Dec 14, 1998
Posts: 20494
    ∞

I've written my own Swing component on top of JComponent. Works great. Especially with the mouse.
I'm trying to put some keyboard stuff in and having a helluva time. Apparently, the AWT stuff won't work. I found something about overriding processComponentKeyEvent(), but that didn't work either. Now I'm working on registerKeyboardAction() ...
Has anyone already been down this path and can part with some advice?

permaculture Wood Burning Stoves 2.0 - 4-DVD set
paul wheaton
Trailboss

Joined: Dec 14, 1998
Posts: 20494
    ∞

Okay - I got the registerKeyboardAction() thing working. But now I can't make it work with the tab key. Wuzzup?
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: catching keyboard events
 
Similar Threads
Setting the cursor in a text field after clicking a button?
WA #1.....word association
key board is not working properly
My aching wrists
Problems with Swing and Swiss keyboard