like the title says. I'm trying to figure out how to keep the focus on the JFrame or perhaps the window. So that when I press F1 on the keyboard, it activates a method. And it should also do it when I'm typing in a textfield.
I have read through the "How to Use the Focus Subsystem" but can't find what I'm looking for. Or maybe I just don't know where to look.
I tried using contentPane.setFocusable(true);
but it looses focus when I activate another component. So how do I get it to keep focus?