title: Is it possible to bring JFrame to front but NOT focus?
body: <p>I'm writing a Java app (Swing GUI) that periodically pops up a JFrame.</p>
  
  <p>Is it possible somehow to bring the window to front (foo.setAlwaysOnTop(true) would be even better) but <strong>without</strong> having it focus?</p>
  
  <p>Some people move their eyes away from the screen from time to time to look at their keyboard while typing, and I'm sure that if this window would always capture the keyboard focus people would get really annoyed as it's causing them to lose quite a few keystrokes every time it pops up unnoticed.</p>
  
  <p>In other cases, even when the user is actually capable of typing without looking at the keyboard all the time, having a window pop up and get focus could cause unwanted actions from the pop-up window itself (some <code>Tab</code>+<code>Enter</code> combination for example, where the user accidentally selects an option she really wouldn't had selected otherwise).</p>
  
  <p>Thanks in advance!</p>
  
  <p><strong>Update</strong></p>
  
  <p>As Jonas suggests, <code>foo.setFocusableWindowState(false);</code> seems to work if called after the window has been rendered (tested on Gnome only).</p>
  
  <p>This does not work:</p>
  
  <pre><code>foo.setFocusableWindowState(false);
  foo.setVisible(true);
  foo.setFocusableWindowState(true);
  </code></pre>
  
  <p>However, this <strong>does</strong>:</p>
  
  <pre><code>foo.setFocusableWindowState(false);
  foo.setVisible(true);
  Thread.sleep(1000);
  foo.setFocusableWindowState(true);
  </code></pre>
  
  <p>I'll have to see if there's an event I can catch/listen to that allows me to do <code>foo.setFocusableWindowStatue(true);</code> when appropriate.</p>
  
  <p>I consider my problem solved.</p>