title: Is there a better practice for Listeners?
body: <p>Say I have a swing GUI, and I want to listen <code>MouseEvents</code>. Who do you think should be the Listener class, who should be responsible? What is the best-or  preferred way to implement it? Any opinions? I usually go like this:</p>
  
  <pre><code>public class MyPanel extends JPanel implements MouseListener{
      private JTable table;
      public void foo(){
           table.addMouseListener(this);
      }
      /* MouseListener */
      //Implement MouseListener here.
  }
  </code></pre>
  
  <p>Is there a better way?</p>
  
  <hr>
  
  <p><strong>EDIT:</strong> Thank you everyone for the wisdom and help. I appreciate it.</p>