//RegularPolygon.java //applet import java.awt.Graphics; import javax.swing.*; public class RegularPolygon extends JApplet { final int radius=300, xcenter=300, ycenter=300; int sides; public void init() { String input; input = JOptionPane.showInputDialog("Enter # of sides of regular polygon"); sides = Integer.parseInt(input); } public void paint(Graphics g) { super.paint(g); int[][] points = new int[2][sides]; //calculate the coords of the points double angle; //radians for (int i=0; i