title: Why doesn't MouseListener work?
body: <p>Here is my main class:</p>
  
  <pre><code>import javax.swing.*;
  
  public class WordProcessor {
  
      public static void main(String[] args) {           
          MainFrame frame = new MainFrame("Word Processor", 10000, 10000);
      }
  } 
  </code></pre>
  
  <p>and i have two other classes</p>
  
  <pre><code>import javax.swing.*;
  
  public class MainFrame extends JFrame {
  
      JMenuBar menubar = new JMenuBar();            
  
      public MainFrame(String name, int x, int y) {
          setTitle(name);
          setSize(x, y);
          setVisible(true);
          setJMenuBar(menubar); 
          //creates file menu and adds to menubar
          //TODO populate with JMenuItems 
          JMenu filemenu = new JMenu("file");
          filemenu.setVisible(true);
          menubar.add(filemenu);
  
          buttonnew buttonnew = new buttonnew("new");
          buttonnew.setVisible(true);
          filemenu.add(buttonnew);
          buttonnew.addMouseListener(buttonnew);
      }
  }
  </code></pre>
  
  <p>and lastly</p>
  
  <pre><code>import javax.swing.*;
  import java.awt.event.*;
  
  public class buttonnew extends JMenuItem implements MouseListener{
  
      buttonnew(String s) {
            super();
            super.setText(s);        
      }
  
      public void mouseClicked(MouseEvent e){         
            System.out.println("hey-o");
      } 
  
      @Override
      public void mouseExited(MouseEvent e) {
      }
  
      public void mouseEntered(MouseEvent e) {
      }
  
      public void mouseReleased(MouseEvent e) {
      }
  
      public void mousePressed(MouseEvent e) {
      }        
  }
  </code></pre>
  
  <p>Nothing happens when i click on buttonneẅ. I'm so lost!</p>