- import objectdraw.*;
- import java.awt.*;
- // A program that displays the words "Pressed" and
- // "Released" where the mouse button is pressed and
- // released.
- public class UpsAndDowns extends WindowController{
- public void onMousePress(Location pressPoint){
- new Text("Pressed", pressPoint, canvas);
- }
- public void onMouseRelease(Location releasePoint) {
- new Text("Released", releasePoint, canvas);
- }
- }
Raw Paste