import element.*; public class Mirror { public static void main(String args[]) { DrawingWindow d = new DrawingWindow(); int width = d.bounds().width(); // window width int height = d.bounds().height(); // and height Pt current, next; // points d.awaitMousePress(); // drawing starts with mouse press current = d.getMouse(); // move pen to initial location while (d.mousePressed()) { next = d.getMouse(); // get next mouse position d.moveTo(current); // draw the "right" image d.lineTo(next); // the "mirrored" points are same distance // away from bottom and right sides; // draw line between them d.moveTo(width-current.x(),height-current.y()); d.lineTo(width-next.x(),height-next.y()); // current point is basis for next line segment current = next; } } }