Mouse events let you track when a mouse is pressed, released, clicked, moved, dragged, when it enters a component, when it exits and when a mouse wheel is moved. Extend this class to create a MouseEvent (including drag and motion events) or/and MouseWheel
Alternatively, use the corresponding AWT MouseAdapter class, which implements the MouseListener, MouseMotionListener, and MouseWheelListener interfaces. The following example shows a mouse listener. At the top of the window is a blank area (implemented by
MouseAdapter implements MouseListener already. The advantage to using MouseAdapter is so you don't have to define everything MouseListener forces you to. It's just an ease of use thing. If you don't need to define every method from MouseListen
Post a Comment:
Showing 0 Comments: