I have a class, like so:
public class MyFrame extends javax.swing.JFrame implements KeyListener { ... }
In the constructor:
addKeyListener(this);
setFocusable(true);
This works as long as the window itself is in focus. If I focus on a component within that window, the key listener no longer listens. I want it so that whenever the window is the active window, but regardless on which specific sub-component the focus is on, the key listener will be triggered. I wish to keep focus traversal keys, for quality of life, but they're not critical.
How do I do this?