import java.awt.*;
import java.awt.event.*;
import java.applet.*;
import java.applet.Applet;
public class test extends Applet
{
private int x,y,width,height;
public void init()
{
width=60;
height=60;
}
public void set(int x,int y)
{
this.x=x;
this.y=y;
}
public void paint(Graphics g)
{
set(20,40);
g.drawRect(x, y, width, height);
g.drawString("坐标x位置"+x, 20, 150);
g.drawString("坐标y位置"+y, 20, 170);
set(200,40);
g.drawRect(x, y, width, height);
g.drawString("坐标x位置"+x, 200, 150);
g.drawString("坐标y位置"+y, 200, 170);
}
}
简单小程序绘图
最新推荐文章于 2023-07-05 23:55:03 发布