title: Can I use main() to restart my application?
body: <p>I am researching a way to restart my java application by clicking a button on the GUI. I searched the web and came across main( new String[0]). I need to understand if this is an valid way to restart my application. Can someone please advise thanks.  </p>
  
  <pre><code>private void bnNewsaleActionPerformed(java.awt.event.ActionEvent evt) {
  
      main( new String[0]);
      }
  </code></pre>
  
  <p>Edit Would this be better?</p>
  
  <pre><code>private void bnNewsaleActionPerformed(java.awt.event.ActionEvent evt) {
      classname.this.dispose();
      main( new String[0]);
      }
  </code></pre>