title: How to organize the controller of a MVC-based program with multiple screens/panels?
body: <p>I'm currently working on a hobby project, written in Java, containing about two different JFrames with about 3-4 JPanels each. The problem I'm facing is that I'm not so sure how to handle the interaction with my controller and different view classes.</p>
  
  <p>For instance, I've an article by Sun on <a href="http://java.sun.com/developer/technicalArticles/javase/mvc/" rel="nofollow noreferrer">Java App. design with MVC</a>, where they list the option to let all the communications between model and view go through the controller as the most modern one, a tactic I've been taught as well and should do just fine. However, it doesn't quite go as deep as to explain how to handle all the ActionListeners involved for all the elements and different panels. </p>
  
  <p>The 'way to go' I've been taught so far is to either use one controller and set the ActionListener to the various objects through getters and keep track of the active panel. The alternative my awesome Java book gives is to just stick to inner classes for each view class. Either method seems to result in pretty nasty code, while I'd prefer one or several controllers with as little bloat as possible.</p>
  
  <p>My question of course is; how would you assign the ActionListeners as neatly and efficiently as possible while keeping the controller(s) usable?</p>