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