title: Java Swing GUI User actions handling
body: <p>How should Listeners etc be managed? I've found only examples with one button etc.</p>
  
  <p>I can think of following options:</p>
  
  <ol>
  <li>Extra class for each - doesn't seem right, especially when items
  can be created dynamically </li>
  <li>Class for each group (such as form1,
  form2, controlButtonsOnLeft, controButtonsOnRight, mainMenu,
  userMenu, ...) where I'll check which button/component caused this
  (via getSource method for example) </li>
  <li>Some super (sized) controller,
  which will accept all user actions </li>
  <li>New anonymous class for each,
  which will call controller's method with parameters specifying
  details (probably enums)</li>
  </ol>
  
  <p>And another question: I've found many examples for MVC, I was wondering what is better (or commonly used) for app. developed by 1 person (app will not be huge)?</p>
  
  <p>A. Viewer sets listeners to controller (A1-3)</p>
  
  <p>B. Controller calls viewer's methods, which accepts listener as parameter (methods addLoginSubmitListener, addControlBoldButtonListener etc)</p>
  
  <p>All of above are possible to implement and so far I would choose B4.
  Meaning in Control I would do something like this:</p>
  
  <pre><code>...
  viewer.addLoginButtonListener(new Listener()
  {
    @Override
    public void actionPerformed(ActionEvent e) {
      ...
      someButtonsActionHandler(SomeButtonEnum, ActionEnum);
      ...
    }
  });
  ...
  private void LoginActionHandler(LoginElementsEnum elem, ActionEnum action)
  {
    if (elem.equals(LOGINBUTTON)) {...}
    ...
  }
  ...
  </code></pre>
  
  <p>This combines readable code (1 logic part at one place in code), doesnt create any unwanted redundant code, doesnt require any hardly-dynamic checks, is easily reusable and more.
  Can you confirm/comment this solution?</p>