|
Code Samples Index
These code examples and other materials are subject to Sun Microsystems, Inc.
Legal Terms
Handling Mouse Motion
component.addMouseMotionListener(
new MyMouseMotionListener());
public class MyMouseMotionListener extends
MouseMotionAdapter {
public void mouseMoved(MouseEvent evt) {
// Process current position of cursor while
// all mouse buttons are up.
process(evt.getPoint());
}
public void mouseDragged(MouseEvent evt) {
// Process current position of cursor
// while mouse button is pressed.
process(evt.getPoint());
}
}
|
Examplets provided by permission of the publisher, Addision-Wesley, and Author Patrick Chan.
Order this book from Amazon
|