/*------------------------------ ex11_8.java アプレット:楕円グラデーション -------------------------------*/ import java.applet.*; import java.awt.*; /* */ public class ex11_8 extends Applet { public void paint(Graphics g) { int x = 190, y = 10, wid = 205, hei = 10; int red = 255, grn = 0, blu = 0; Color col; for (int i = 0; i < 20; i++) { col = new Color(red,grn,blu); g.setColor(col); g.drawOval(x, y, wid, hei); x -= 10; y += 5; wid -= 10; hei += 20; red -= 5; grn += 10; blu += 1; } g.setColor(Color.yellow); x = 170; y = 200; wid = 30; hei = 20; for (int i = 0; i < 10; i++) { g.fillRect(x,y,wid,hei); y += 20; wid += 20; } } }