package pertemuan13_pbo; import java.awt.BorderLayout; import java.awt.Color; import java.awt.GradientPaint; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.awt.geom.RoundRectangle2D; import javax.swing.JFrame; import javax.swing.JPanel; /** * * @author admin */ public class ShapePanel extends JPanel { public ShapePanel() { setBackground(Color.white); } @Override public void paintComponent(Graphics g) { super.paintComponent(g); g.setColor(Color.BLUE); g.drawLine(0, 10, 50, 60); g.setColor(Color.red); g.drawRect(50, 10, 50, 50); g.setColor(new Color(255, 0, 0)); g.fillOval(100, 10, 50, 50); g.setColor(new Color(0, 255, 0)); g.fillArc(150, 10, 50, 50, 0, 180); Graphics2D g2 = (Graphics2D) g; // fill RoundRectangle2D.Double GradientPaint redtowhite = n