title: Restart application by disposing the old
body: <p>Good day, I was looking for a way of restarting my application, I came up of with a concept of this: </p>
  
  <pre><code>submit.addActionListener(new ActionListener() {
  
              public void actionPerformed(ActionEvent event) {
  
                new Application();
                dispose();
  
  
              }
          });
  </code></pre>
  
  <p>Where the Object that is being disposed of, is the new Object that is being created . My question is if it is a good way of restarting the application? Why not? and is there a better way?</p>
  
  <p>P.S if similar question exist I truly could not have found it.</p>