title: Java mouselistener
body: <p>How do I go about writing a mouse listener that will react to pressing on any object in a <code>JFrame</code>, or on one particular object?</p>
  
  <p>Here's my mouse listener -</p>
  
  <pre><code>class mouse extends MouseAdapter
  {
     public void  mousePressed(MouseEvent event)
     {
       yearLabel.setText("nu");
     }
   }
  </code></pre>