title: Java Event Binding
body: <p>I'm new in windows application development using java. The question is this "How to i bind events to custom class methods?</p>
  
  <p>As fas i have seen i can register listener classes to swing components to handle events. That is OK but i have to implement a class that implements e.g. the ActionListener interface to handle an event and then implement the actionPerformed method. That means ONE class FOR each event i have  to handle?</p>
  
  <p>Can't i have ONE class "listening" for events from all components and have each method in this class do the event handling?"</p>
  
  <p>An example:</p>
  
  <pre><code>class MyEventListener { //pseudo code [no constructors, etc]
  
      public void handleSubmitFormBtn(Event e) {
  
      }
  
      //other methods go here handling events from other swing components
  }
  </code></pre>
  
  <p>Note: I am not sure about the method signature but i hope that you get the point.</p>
  
  <p>Conclusion: ONE method to handle events fired from swing components..is it possible? Is the creation of ONE class for each the event the only way? Can't i route event handling to specific methods for a single class?</p>