1. /*
  2. * @(#)MouseListener.java 1.11 01/11/29
  3. *
  4. * Copyright 2002 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package java.awt.event;
  8. import java.util.EventListener;
  9. /**
  10. * The listener interface for receiving "interesting" mouse events
  11. * (press, release, click, enter, and exit) on a component.
  12. * (To track mouse moves and mouse drags, use the MouseMotionListener.)
  13. * <P>
  14. * The class that is interested in processing a mouse event
  15. * either implements this interface (and all the methods it
  16. * contains) or extends the abstract <code>MouseAdapter</code> class
  17. * (overriding only the methods of interest).
  18. * <P>
  19. * The listener object created from that class is then registered with a
  20. * component using the component's <code>addMouseListener</code>
  21. * method. A mouse event is generated when the mouse is pressed, released
  22. * clicked (pressed and released). A mouse event is also generated when
  23. * the mouse cursor enters or leaves a component. When a mouse event
  24. * occurs the relevant method in the listener object is invoked, and
  25. * the <code>MouseEvent</code> is passed to it.
  26. *
  27. * @see MouseAdapter
  28. * @see MouseEvent
  29. * @see <a href="http://java.sun.com/docs/books/tutorial/post1.0/ui/mouselistener.html">Tutorial: Writing a Mouse Listener</a>
  30. * @see <a href="http://www.awl.com/cp/javaseries/jcl1_2.html">Reference: The Java Class Libraries (update file)</a>
  31. *
  32. * @version 1.7 08/02/97
  33. * @author Carl Quinn
  34. */
  35. public interface MouseListener extends EventListener {
  36. /**
  37. * Invoked when the mouse has been clicked on a component.
  38. */
  39. public void mouseClicked(MouseEvent e);
  40. /**
  41. * Invoked when a mouse button has been pressed on a component.
  42. */
  43. public void mousePressed(MouseEvent e);
  44. /**
  45. * Invoked when a mouse button has been released on a component.
  46. */
  47. public void mouseReleased(MouseEvent e);
  48. /**
  49. * Invoked when the mouse enters a component.
  50. */
  51. public void mouseEntered(MouseEvent e);
  52. /**
  53. * Invoked when the mouse exits a component.
  54. */
  55. public void mouseExited(MouseEvent e);
  56. }