drawing in a frame drawing the line
{"Image DocumentName": "Drawing in a frame Drawing the line.", "Image ImageDescription": "// Star.java - draws a star. import javax.swing. ; import java.awt. ; class Star extends JComponent{ public void paint (Graphics g){ double x1, x2, y1, y2; for (double angle=0; angle<Math.PI; angle = angle + Math.PI / 16) { x1=Math.cos(angle)   RADIUS + RADIUS; y1=Math.sin(angle)   RADIUS + RADIUS; x2=Math.cos(angle + Math.PI)   RADIUS + RADIUS; y2=Math.sin(angle + Math.PI)   RADIUS + RADIUS; g.drawLine((int)x1, (int)y1,(int)x2, (int)y2); } public Dimension getMinimumSize(){ return new Dimension(2   RADIUS, 2   RADIUS); public Dimension getPreferredSize(){ private static final int RADIUS = 100; Drawing the line. This requires 4 points and they need to be integers, so we cast these variables as integers (they are actually doubles)", "Image XResolution": "37", "Image YResolution": "37", "Image ResolutionUnit": "Pixels/Centimeter", "Image Software": "SlidePlayer", "Image YCbCrPositioning": "Centered"}