title: mouseEntered and mouseExited method questions
body: <p>Working on a homework assignment and I'm having issues with figuring out how to print a line of text when a mouse cursor enters and exits a certain colored area (a JPanel called panel in this case) while using the MouseListener interface.</p>
  
  <p>I choose a color from the bottom panel (either Red, blue, or yellow) and then when I move to the upper panel it should be able to print which color the mouse has entered in while the mouse is in the panel and which color I exited from when my mouse finds itself outside of said panel...</p>
  
  <p>Hopefully that makes sense. Here's a code snippet of what I have so far. This is for the color RED:</p>
  
  <pre><code>class RedButtonListener implements ActionListener
      {
          public void actionPerformed(ActionEvent event)
          {
              panel.setBackground(Color.RED); 
              class RedMouseListener implements MouseListener
              {
  
                  public void mouseEntered(MouseEvent event) 
                  { 
  
                  }
  
                  public void mouseExited(MouseEvent event) 
                  { 
  
                  }
  
                  public void mousePressed(MouseEvent event) { }
  
                  public void mouseReleased(MouseEvent event) { }
  
                  public void mouseClicked(MouseEvent event) { }
              }
          }
      }
      ActionListener redListener = new RedButtonListener();
      bRed.addActionListener(redListener);
  </code></pre>