A Java MouseListener example, with addMouseListener, mousePressed, mouseReleased, mouseEntered, mouseExited, mouseClicked, and MouseEvent
public interface MouseListener extends EventListener The listener interface for receiving "interesting" mouse events (press, release, click, enter, and exit) on a component. (To track mouse moves and mouse drags, use the MouseMotionListener .)
The following example shows a mouse listener. At the top of the window is a blank area (implemented by a class named BlankArea). The mouse listener listens for events both on the BlankArea and on its container, an instance of MouseEventDemo. Each time a m
Post a Comment:
Showing 0 Comments: