|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?注册
x
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 |
|