I try to add a KeyListener to a JFrame. This works fine like this.
JFrame frame = new JFrame();
[...]
frame.addKeyListener(new KeyListener() { [...] });
However, when I have the focus on a button or on a JTextField (like when I click on it), that KeyListener won't react to my button pushes.
Do you know how to fix this?