Redirecting keystrokes to other components

I have a chat program with several components on it, one of them is a JTextField that is used to send chat messages. It would be nice to be able to start typing into the field even when the focus is on one of the other components (the room user list, for example). I'm not quite sure how to go about setting that up. I would like to be able to use arrow keys and pg-up and pg-down on the other components before the user starts typing, but to have the focus go to the JTextField after.

Any suggestions?

[516 byte] By [pixel2001na] at [2007-11-27 10:27:41]
# 1

not sure about keystrokes, but why not use requestFocusInWindow call to set the focus onto the window that you want ?

KeyzerSuzea at 2007-7-28 17:47:11 > top of Java-index,Desktop,Core GUI APIs...
# 2

Hi

You can try to use dispatchEvent in order to capture some event from some component to these JFieldText.

Hope this helps

yomismoa at 2007-7-28 17:47:11 > top of Java-index,Desktop,Core GUI APIs...