Adding a KeyListener to a JPanel
843804Jun 5 2005 — edited Jun 5 2005I have a JPanel (lets call it mainpanel) with 4 JPanel's inside, and inside this JPanel's i have JButtons, TextArea's etc. Is it possible to add only one KeyListener to the mainpanel, that would work even, if one of the JButtons or other components is focused, or have i to add the listener to all components in the Panel??