// CSE 142, Spring 2010, Marty Stepp // This client program creates and uses several Point objects. import java.awt.*; public class PointClient { public static void main(String[] args) { // create three Point objects Point p1 = new Point(); p1.x = 11; p1.y = 11; Point p2 = new Point(); p2.x = 22; p2.y = 32; Point p3 = new Point(); p3.x = 103; p3.y = 283; // test our distance method System.out.println("distance from p1 to p2 = " + p1.distance(p2)); System.out.println("distance from p2 to p3 = " + p2.distance(p3)); // call our new translate method p1.translate(5, 8); p2.translate(-1, 1000); // call our new toString method System.out.println("p1 is: " + p1); System.out.println("and p2=" + p2); System.out.println("also " + p3 + " is the state of p3"); // call our draw method DrawingPanel panel = new DrawingPanel(500, 400); Graphics g = panel.getGraphics(); p1.draw(g); p2.draw(g); p3.draw(g); } }