﻿// MyGraph005.java						2003.05.22
//								2003.05.21
//							by M.Yanaka
//	ウィンドウの中央に，適当な大きさで，描く

import	java.awt.*;
import	java.awt.event.*;

public class MyGraph005 extends Frame {

	public MyGraph005(String title) {
		super(title);
		setSize(512,512);
		addWindowListener(new WindowAdapter() {
                    public void windowClosing(WindowEvent evt) {
                        dispose();
                    }
                    public void windowClosed(WindowEvent evt) {
			System.exit(0);
                    }
                } );
		setVisible(true);
	}

	public static void main(String argv[]) {
		MyGraph005 app = new MyGraph005("円(MyGraph005)");
	}

	public void paint(Graphics g) {
		Dimension size = getSize();
		int r;
		if (size.width < size.height)
			r = size.width / 4;
		else
			r = size.height / 4;
		g.drawOval(size.width / 2 - r, size.height / 2 - r, r * 2 + 1, r * 2 + 1);
	}
}
