title: Java Application Restart or Reset Button
body: <p>I have a very simple, choose your path, Java game that I am working on in the NetBeans IDE. Basically what happens is the user will click one of the three buttons, and pre-made <code>JLabel</code>'s which are set to <code>""</code> (nothing) will be reset to whatever text I decide that label should then use. I do this by adding the code below.</p>
  
  <pre><code>private void option1ActionPerformed(java.awt.event.ActionEvent evt) {
      jLabel6.setText("You go down the dark tunnel...");
  }
  </code></pre>
  
  <p>Now all this works fine but I'd like a way to restart/reset my application by clicking a button labelled "restart". I don't mind if it has to close the application and then open it again or if it will simply reset all the JLabel's back to "". I just don't want to have to type out the code below for every single JLabel.</p>
  
  <pre><code>jLabel1.setText("");
  jLabel2.setText("");
  jLabel3.setText("");
  </code></pre>
  
  <p>I have done some research on this site and none of the code that people provide seems to work for my situation, either because it simply doesn't work or because I am doing something wrong. Any help would be greatly appreciated and please try and be specific because I am fairly new to writing Java and don't understand everything.</p>
  
  <p>It would also work for me if someone could provide a way for me to close 1 window in an application instead of the whole thing, like when</p>
  
  <pre><code>System.exit(0);
  </code></pre>
  
  <p>is used.</p>