title: Restore minimized JFrame that has been locally created
body: <p>My class <code>Output.java</code> extends <code>JPanel</code>. From another class, the user can click on an icon and then it locally creates a <code>JFrame</code> with the <code>Output.java</code>. We found that sometimes the user minimizes that window and then will want it back. He will then reclick on the icon and the <code>JFrame</code> is recreated. By doing it a few times, the <code>Output.java</code> class is displayed several times.</p>
  
  <p>I've found that it is possible to disable multiple <code>JFrame</code> creation by adding this:</p>
  
  <pre><code>    if (!output.isShowing())
          openPage(output);
  </code></pre>
  
  <p>But it doesn't restore the <code>JFrame</code>. Is there a way to restore a minimized <code>JFrame</code> in this situation?</p>
  
  <pre><code>icon.addMouseListener(new MouseAdapter() {  
      public void mouseClicked(MouseEvent e) {  
          openPage(outputsSlavePane);
      }  
  });
  
  private void openPage(final Output panel) {
      JFrame frame = new JFrame("Output");
      frame.add(panel);
      frame.setLocationRelativeTo(null);
      frame.setVisible(true);
      frame.addWindowListener(new WindowAdapter() {
          @Override
          public void windowClosing(WindowEvent e) {
              panel.setLostFocus();
          }
      });
  }
  </code></pre>
  
  <p>Thanks.</p>