How to make constant focus?

I have several Panels beside and inside each other. Is there a way to make a keyListener that always is notified no matter what panel has taken the focus ?

I hope we have a genie out there :slight_smile:

setFocusable(false) everywhere… except that one thing with the listeners attached.

Since java 1.4, you can use a KeyEventPostProcessor (which takes care of key events not consumed by other components).

Lilian

Thankyou. I made another solution.

could you share it?

I had to get focus on a certain panel to use the arrow keys for scrolling, but I used a JScrollPanel instead.