// CSE 142, Autumn 2010, Marty Stepp // This "client" program uses our Point class. // Today's version uses the methods and constructor that we wrote. import java.awt.*; // for Graphics public class PointClient { public static void main(String[] args) { // create two Point objects Point p1 = new Point(51, 21); Point p2 = new Point(182, 12); System.out.println(p1.distance(p2)); // uses the toString method System.out.println("p1 is " + p1); System.out.println("p2 is " + p2); // move p2 and then print it p2.x += 2; p2.y++; System.out.println("p1 is " + p1); System.out.println("p2 is " + p2); // 98, 52 // draw the two points on a DrawingPanel DrawingPanel panel = new DrawingPanel(200, 200); Graphics g = panel.getGraphics(); p1.draw(g); p2.draw(g); } }