title: Concurrency in Swing.
body: <p>I seem to need some explaining on proper techniques using Swing. </p>
  
  <p>I am a recent graduate and have just built my first program to transform CSV files from third party vendors into a readable format for the ETL tool my job uses. </p>
  
  <p>Currently I start with a main method that calls a simple frame to ask the user to find the file. It is a standalone class that uses JFileReader and the user selects the file using that. Once they select the file and hit okay I dispose of that frame and load another frame that is a completely different class. I do this in one of the methods of said class. I do this multiple times until I reach the last frame which then before its method ends calls creates a new instance of the first class again. </p>
  
  <p>So pretty much the sequence goes like this. </p>
  
  <p>New class1 - dispose class1 - new class2 -dispose class2 - new class3 - dispose class3 - new class1. </p>
  
  <p>This program works great for what it needs to do. But for myself I know this has to be the wrong way to do it. As far as I know when a method ends all members of that method are then unreferenced. How is it that my program continues to loop in this form? Is there something about a class that extends JFrame that gives it control? Am I just passing control from one Frame to another? Also would this eventually cause a memory problem if used enough (are the older classes really getting disposed of)?</p>