いろいろな描画

source は以下のとおり

import java.awt.*;

public class variousDraw extends java.applet.Applet {
  Font tp = new Font("TimesRoman", Font.PLAIN, 24);
  Font tb = new Font("TimesRoman", Font.BOLD, 24);
  Font ti = new Font("TimesRoman", Font.ITALIC, 24);
  Font hp = new Font("Helvetica", Font.PLAIN, 24);
  Font hb = new Font("Helvetica", Font.BOLD, 24);
  Font hi = new Font("Helvetica", Font.ITALIC, 24);
  Font cp = new Font("Courier", Font.PLAIN, 24);
  Font cb = new Font("Courier", Font.BOLD, 24);
  Font ci = new Font("Courier", Font.ITALIC, 24);
  
  public void init() {
    setForeground(Color.blue);
    setBackground(Color.white);
  }
  
  public void paint(Graphics g) {
    g.drawLine( 10, 30, 40, 10);  // 線分
    g.drawRect( 50, 10, 30, 20);  // 長方形
    g.fillRect( 90, 10, 30, 20);  // 長方形(塗りつぶし)
    g.drawOval(130, 10, 30, 20); // 楕円
    g.fillOval(170, 10, 30, 20); // 楕円(塗りつぶし)
    
    g.drawRoundRect(210, 10, 30, 20, 5, 5);
    g.fillRoundRect(250, 10, 30, 20, 5, 5);

    g.draw3DRect( 10, 50, 30, 20, true);
    g.fill3DRect( 50, 50, 30, 20, false);
    g.drawArc(    90, 50, 30, 20,  0,  90);
    g.fillArc(   130, 50, 30, 20, 90, 340);


    g.setFont(tp);  g.drawString("TimesRoman", 10, 110);
    g.setFont(tb);  g.drawString("Bold",      150, 110);
    g.setFont(ti);  g.drawString("Italic",    220, 110);
    g.setFont(hp);  g.drawString("Helvetica",  10, 140);
    g.setFont(hb);  g.drawString("Bold",      150, 140);
    g.setFont(hi);  g.drawString("Italic",    220, 140);
    g.setFont(cp);  g.drawString("Courier",    10, 170);
    g.setFont(cb);  g.drawString("Bold",      150, 170);
    g.setFont(ci);  g.drawString("Italic",    220, 170);
  }
}
drawLine(x1, x2, y1, y2)
点 (x1, x2) と点 (y1, y2) を線分で結ぶ
drawRect(x, y, w, h)
点 (x, y) を左上隅とする幅 w,高さ h の長方形を描く
fillRect(x, y, w, h)
同上(塗りつぶし)
drawOval(x, y, w, h)
点 (x, y) を左上隅とする幅 w,高さ h の長方形に内接する楕円を描く
fillOval(x, y, w, h)
同上(塗りつぶし)
drawString("文字列", x, y)
点 (x, y) を左下隅とする長方形領域に文字列を描く
drawRoundRect(x, y, w, h, arcx, arcy)
角のとれた長方形を描く
fillRoundRect(x, y, w, h, arcx, arcy)
角のとれた長方形を描く(塗りつぶし)