import java.awt.*; import java.util.*; public class Draw { public static void main(String[] args) { DrawingPanel panel = new DrawingPanel(400, 300); Graphics g = panel.getGraphics(); /* Polygon poly = new Polygon(); poly.addPoint(10, 30); poly.addPoint(20, 50); poly.addPoint(30, 90); poly.addPoint(20, 50); poly.addPoint(10, 70); g.fillPolygon(poly); */ int[] xValues = {10, 20, 30, 100, 190, 150, 20, 10}; int[] yValues = {30, 50, 90, 20, 50, 90, 50, 70}; g.fillPolygon(xValues, yValues, xValues.length); for (int i = 0; i < xValues.length; i++) { System.out.print(xValues[i] + " "); } System.out.println(); Arrays.sort(xValues); for (int i = 0; i < xValues.length; i++) { System.out.print(xValues[i] + " "); } System.out.println(); int indexOf100 = Arrays.binarySearch(xValues, 100); System.out.println("Where is 100? " + indexOf100); int indexOf200 = Arrays.binarySearch(xValues, 200); System.out.println("Where is 200? " + indexOf200); } }