Practical No-11
Practical No-11
MouseListener Interface
MouseListener Interface
• Mouse event occurs when a mouse related activity is
performed on a component such as clicking, dragging, pressing,
moving or releasing a mouse etc.
• Objects representing mouse events are created from
MouseEvent class.
• The Java MouseListener is notified whenever you change the
state of mouse.
• It is notified against MouseEvent.
• The MouseListener interface is found in java.awt.event
package.
• It has five methods.
1. public abstract void mouseClicked(MouseEvent e); -Invoked when the
mouse button has been clicked (pressed and released) on a component