title: Can an event in one class trigger an action in another class?
body: <p>I'm writing a program that completes the following tasks in sequence:</p>
  
  <ol>
  <li>Collects user input from a JPanel</li>
  <li>Uses the input to copy dependencies from the program directory into a new project directory</li>
  <li>Uses the input to construct an interactive graph in the project directory </li>
  </ol>
  
  <p>I have a separate class for each task and a main class that calls each object in sequence.</p>
  
  <p>My problem is that the main class evaluates step 2 before step 1 is complete. Because the user has not yet closed the JPanel when the main class calls object 2, the user input is not collected before step 2 starts and the program crashes.</p>
  
  <p>What I need is a way to signal to class 2 that the JPanel in class 1 has been closed. This way step 2 begins <em>after</em> the input fields have been collected in step 1.</p>
  
  <p>Is there a way to have the window closing in class 1 trigger an action in class 2? If not, what would be the best way to solve this problem?</p>