title: Java - cannot bring the window to front
body: <p>I am trying to execute the following code:</p>
  
  <pre><code>SwingUtilities.invokeLater(new Runnable() {
                              public void run() {
                                  if (frame.getExtendedState() == Frame.ICONIFIED)
                                      frame.setExtendedState(Frame.NORMAL);
                                  frame.getGlassPane().setVisible(!frame.getGlassPane().isVisible());
  
                                  frame.toFront();
                                  frame.repaint();
  
                              }
                          });
  </code></pre>
  
  <p>Unfortunately this does not bring it to the front from behind other windows...  Any solutions?</p>