title: Moving from one JFrame to another
body: <p>In a package in Netbeans I created two JFrame Forms, first one is Login, second is, mainProgram, after the successful log in, I use the following way to "close" the Login frame and open the main program frame.</p>
  
  <pre><code>mainProgram m=new mainProgram();
  m.setVisible(true);
  setVisible(false); //to hide the log in frame
  </code></pre>
  
  <p>Is this the correct way? Isn't it wrong if these two separated classes are hidden instead of being closed? are these one process or two different processes? if there's a better way then what is it?</p>
  
  <p>thanks..</p>