javaApplet编写的简单画图程序

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

javaApplet文件

import java.awt.*;

import java.applet.*;

public class Ycc5 extends Applet {

Font f=new Font("华文新魏",Font.BOLD,18);

public void paint(Graphics g) {

g.setColor(Color.red);

g.fillOval(200,100,100,100);

g.drawOval(200,100,100,100);

g.setColor(Color.black);

g.drawLine(170,80,200,110);

g.drawLine(250,50,250,90);

g.drawLine(340,80,300,110);

g.drawLine(150,150,190,150);

g.drawLine(170,210,200,190);

g.drawLine(250,240,250,210);

g.drawLine(340,210,300,190);

g.drawLine(310,150,350,150);

g.setColor(new Color(62,167,252)); int[]x={550,700,750,500,550};

int[]y={350,350,400,400,350};

g.drawPolygon(x,y,5);

g.fillPolygon(x,y,5);

g.drawRect(510,400,230,180);

g.setColor(new Color(44,252,85));

g.drawRect(650,420,60,70);

g.fillRect(650,420,60,70);

g.setColor(Color.black);

g.drawLine(650,455,710,455);

g.drawLine(680,420,680,490);

g.drawRect(560,300,20,80);

g.setColor(Color.yellow);

g.drawRect(560,500,50,79);

g.fillRect(560,500,50,79);

g.setColor(Color.blue);

}

}

Html文件

code = "Ycc5.class"

width = "800"

height = "600"

>

相关文档
最新文档