tread bintang UTS
import java.awt.Color; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.geom.GeneralPath; import java.awt.geom.Rectangle2D; import java.util.Random; import javax.swing.JPanel; public class Bintang extends JPanel { private static GeneralPath gp; int jum=1; // draw general paths @Override public void paintComponent( Graphics g ) { super.paintComponent( g ); // call superclass's paintComponent Random random = new Random(); // get random number generator Graphics2D g2d = ( Graphics2D ) g; g2d.translate( 200, 200 ); // translate the origin to (200, 200) if (jum==18) jum=0; // rotate around origin and draw stars in random colors for ( int count = 1; count <= jum; count++ ) { g2d.rotate( Math.PI / 9.0 ); // rotate coordinate system // set random drawing color g2d.setColor( new Color( random.nextInt( 256 ),