1. /*
  2. * @(#)MouseListener.java 1.16 03/01/23
  3. *
  4. * Copyright 2003 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
  13. * <code>MouseMotionListener</code>.)
  14. * <P>
  15. * The class that is interested in processing a mouse event
  16. * either implements this interface (and all the methods it
  17. * contains) or extends the abstract <code>MouseAdapter</code> class
  18. * (overriding only the methods of interest).
  19. * <P>
  20. * The listener object created from that class is then registered with a
  21. * component using the component's <code>addMouseListener</code>
  22. * method. A mouse event is generated when the mouse is pressed, released
  23. * clicked (pressed and released). A mouse event is also generated when
  24. * the mouse cursor enters or leaves a component. When a mouse event
  25. * occurs, the relevant method in the listener object is invoked, and
  26. * the <code>MouseEvent</code> is passed to it.
  27. *
  28. * @author Carl Quinn
  29. * @version 1.16, 01/23/03
  30. *
  31. * @see MouseAdapter
  32. * @see MouseEvent
  33. * @see <a href="http://java.sun.com/docs/books/tutorial/post1.0/ui/mouselistener.html">Tutorial: Writing a Mouse Listener</a>
  34. * @see <a href="http://www.awl.com/cp/javaseries/jcl1_2.html">Reference: The Java Class Libraries (update file)</a>
  35. *
  36. * @since 1.1
  37. */
  38. public interface MouseListener extends EventListener {
  39. /**
  40. * Invoked when the mouse button has been clicked (pressed
  41. * and released) on a component.
  42. */
  43. public void mouseClicked(MouseEvent e);
  44. /**
  45. * Invoked when a mouse button has been pressed on a component.
  46. */
  47. public void mousePressed(MouseEvent e);
  48. /**
  49. * Invoked when a mouse button has been released on a component.
  50. */
  51. public void mouseReleased(MouseEvent e);
  52. /**
  53. * Invoked when the mouse enters a component.
  54. */
  55. public void mouseEntered(MouseEvent e);
  56. /**
  57. * Invoked when the mouse exits a component.
  58. */
  59. public void mouseExited(MouseEvent e);
  60. }