Graphics Sampler
resize(width, height); // ウインドウサイズ
setBackground(Color.lightGray); // 背景の色
g.setColor(new Color(255,0,0)); // set color
g.drawLine(25, 10, 150, 80); // draw a line
g.fillArc(225, 10, 150, 80, 90, 135); // draw an arc
g.drawArc(225, 10, 150, 80, 90, 135);
g.fillRect(25, 110, 150, 80);
g.drawRect(25, 110, 150, 80);
// draw a rounded rectangle
g.fillRoundRect(225, 110, 150, 80, 20, 20);
g.drawRoundRect(225, 110, 150, 80, 20, 20);
// clear an area for it first
g.clearRect(20, 205, 160, 90);
g.draw3Drect(25, 210, 150, 80, true); // 3D rectangle
g.fillOval(225, 210, 150, 80); // draw an oval
g.drawOval(225, 210, 150, 80);
g.fillPolygon(xpoints, ypoints, numpoints);
g.drawPolygon(xpoints, ypoints, numpoints+1);
g.drawString("fillRect()", 60, 140); // draw strings
g.drawImage(image, 320, 40, c); // draw an image