Chinaunix首页 | 论坛 | 博客
  • 博客访问: 376198
  • 博文数量: 1051
  • 博客积分: 53280
  • 博客等级: 大将
  • 技术积分: 6670
  • 用 户 组: 普通用户
  • 注册时间: 2008-09-09 13:21
文章分类

全部博文(1051)

文章存档

2011年(1)

2008年(1050)

我的朋友

分类:

2008-09-09 16:48:02

import java.awt.*;
import java.awt.event.*;

public class ThreeInOne {
    public static void main(String args[]) {
        Three t = new Three();
        t.display();
    }
}

class _paint extends Panel implements ActionListener {
    public int p_count = 0, flag = 0;
    int point[][] = new int[100][2];
    double h[], ath[], c[], b[], d[], s2[], s1;
    double a[], rs[];

    int tempx, tempy;

    public _paint() {
        p_count = 0;
        this.addMouseListener(new IsMouseClicked());
    }

    
// /////////////////////////

    public void p_random() {
        Graphics g = getGraphics();
        g.setColor(Color.black);
        int i, set = 0, j, flag = 0;
        
// p_count=10;

        for (i = 0; i < 6; i++) {
            set = 0;
            while (set == 0) {
                
//System.out.println("1_");

                tempx = (int) (Math.random() * 1000);
                if (tempx >= 50 && tempx <= 690) {
                    point[p_count][0] = tempx - 401;
                    set = 1;
                }
            }
            set = 0;
            while (set == 0) {
                
//System.out.println("2_");

                tempy = (int) (Math.random() * 1000);
                if (tempy >= 200 && tempy <= 300) {
                    point[p_count][1] = -tempy + 281;
                    set = 1;
                }
            }
            
//System.out.println("3_");

            p_count++;
            g.fillOval(tempx, tempy, 5, 5);
        }
    }

    
// ////////////////////////////

    public void paint(Graphics g) {
        g.setColor(Color.black);
        Font fntName = new Font("Serif", 0, 40);
        g.setFont(fntName);

        g.drawString("y", 378, 50);
   &n


--------------------next---------------------

阅读(233) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~