// (c) 1998 duane a. bailey import element.*; public class DrawRoundRect { public static void main(String args[]) { DrawingWindow d = new DrawingWindow(); Pt pressPoint, releasePoint, clickPlace; Rect box; RoundRect roundBox; pressPoint = d.awaitMousePress(); releasePoint = d.awaitMouseRelease(); box = new Rect(pressPoint,releasePoint); d.draw(box); d.awaitMousePress(); clickPlace = d.awaitMouseRelease(); roundBox = new RoundRect(box, 2*(clickPlace.x()-box.left()), 2*(clickPlace.y()-box.top())); d.clear(d.bounds()); d.draw(roundBox); } }