title: Java swing - Where should the ActionListener go?
body: <p>By convention, where should the ActionListener for a user inteface go? I have several options but none of them seem quite right.</p>
  
  <p>Shorthand:</p>
  
  <ul>
  <li>GUI - main class that contains all the JPanels/displayable objects</li>
  <li>Logic - main class that handles application logic</li>
  </ul>
  
  <hr>
  
  <ol>
  <li>I could in-line declare a new ActionListener in GUI, store it, and then it/pass its pointer around to where it's needed.</li>
  <li>I could make GUI itself implement ActionListener and pass a reference to itself to where it's needed.</li>
  <li>I could in-line declare a new ActionListener in the main logic (this makes sense since the actions the buttons do are logic that shouldn't be in the GUI) and then pass it to GUI which will pass it to where it's needed.</li>
  <li>I could write the logic in a whole new file GUIListener.java and declare GUIListener where it's needed/pass it around.</li>
  <li>Some other method, I'm sure there are tons.</li>
  </ol>