title: How to handle event several layers deep, Java
body: <p>I have a fairly complicated program that I have setup. In that program is a preferences window. One of the preferences is the server that the program is connected to. When the user changes that server, or adds another, the program needs to "restart" (dispose of and recreate the <code>main_window</code> class).</p>
  
  <p>However I am lost on the best practices of how to do this. Here is the basic scenario in a stacked approach:</p>
  
  <p><code>main</code> Overall class, used for starting. Creates the main window class.</p>
  
  <p><code>main_window</code> JFrame that displays the data to the user</p>
  
  <p><code>prefs</code> JFrame that has many user settable options</p>
  
  <p><code>Server_Editor_Dialog_Box</code> JFrame that when the user hits OK, must restart the program</p>
  
  <p>Anyways, My question is how do I notify main that something happened in ServerEditorDialogBox, and the program needs to restart. Should I throw an exception? Should I have a listener chain SEDB->prefs->main_window->main? Or should I do something entirely different?</p>