title: How do I lose the focus on a JFrame?
body: <p>I'm making some kind of on-screen keyboard in java. So I need the JFrame to lose focus (and thus, transfer focus to the next window) to send the key strokes. Is there a way to make the JFrame window lose focus?</p>
  
  <p>For example, on Windows, if you open the native on-screen keyboard, you can press the buttons on there while the on-screen window itself is not in focus but instead, a different window gets the input.
  <img src="https://i.stack.imgur.com/XBA2k.png" alt="enter image description here"></p>
  
  <p>For clarity, I'm trying to replicate what the native on-screen keyboard does. So the one I'm making will be used on any and all windows that I have open, not just Java. I'm using the Robot class to simulate the keystrokes.</p>
  
  <p>To sum it off, I need my JFrame to:</p>
  
  <ul>
  <li>Stay on top of other windows (Done. By using <code>setAlwaysOnTop(true);</code>)</li>
  <li>Not have focus (So the key strokes can be send to whatever the top-level window is at the moment instead)</li>
  </ul>