Handling Mouse Events (cont)
public void mouseReleased (MouseEvent e) {
selectedPoint = null;
}
public void mouseDragged (MouseEvent e) {
if (selectedPoint != null) {
selectedLS.updateLocation(
selectedPoint, e.getX(), e.getY() );
repaint();
}
}
public void mouseMoved (MouseEvent e) {}
}
Previous slide
Next slide
Back to first slide
View graphic version