JAVA   79
UpsAndDowns
Guest on 9th February 2023 03:10:25 AM


  1. import objectdraw.*;
  2. import java.awt.*;
  3.  
  4. // A program that displays the words "Pressed" and
  5. // "Released" where the mouse button is pressed and
  6. // released.
  7. public class UpsAndDowns extends WindowController{
  8.     public void onMousePress(Location pressPoint){
  9.         new Text("Pressed", pressPoint, canvas);
  10.     }
  11.  
  12.     public void onMouseRelease(Location releasePoint) {
  13.         new Text("Released", releasePoint, canvas);
  14.     }
  15. }

Raw Paste

Login or Register to edit or fork this paste. It's free.