title: What is the controller in Java Swing?
body: <p>I would like to apply the MVC design to my Java application using Swing in a meaningful way. Therefore my question is, how the controllers would be structured in Java Swing?</p>
  
  <p>I have two options in mind:</p>
  
  <ol>
  <li>Every Component Listener is an own class, as part of the controller package</li>
  <li>Every Component Listener is an anonymous class inside the view package which delegates its call to a class with controller methods.</li>
  </ol>
  
  <p>Is both possible? Is it a question of preference, or is it clearly defined?</p>