import java.applet.Applet;
import java.awt.Color;
import java.awt.Graphics;
public class Test extends Applet
{
/**
*
*/
private static final long serialVersionUID = -6059738190801891376L;
class Point
{
public int x, y;
}
Point p1, p2;
public void start()
{
p1 = new Point();
p1.x = p1.y = 0;
p2 = new Point();
p2.x = p2.y = 100;
}
public void paint(Graphics g)
{
g.setColor(Color.red);
g.drawLine(p1.x, p1.y, p2.x, p2.y);
}
}
② 鎬庝箞緙栧啓涓涓綆鍗旿ava搴旂敤紼嬪簭錛岃緭鍑鴻嚜宸辯殑濮撳悕鍜屽﹀彿錛
涓嬮潰鏄涓涓猨ava 灝忕▼搴忓疄鐜扮殑x0dx0aimport java.awt.*;//寮曞叆鍖匼x0dx0aimport java.applet.Applet;//寮曞叆鍖匼x0dx0apublic class Output extends Applet//瀹氫箟綾籠x0dx0a{x0dx0a //瀹氫箟鍙橀噺x0dx0a private String name;x0dx0a private int num;x0dx0a //鍒濆嬪寲x0dx0a public void init()x0dx0a {x0dx0a name = getParameter("vname");x0dx0a num = Integer.parseInt(getParameter("vnum"));x0dx0a }x0dx0a //杈撳嚭x0dx0a public void paint(Graphics g)x0dx0a {x0dx0a g.drawString ("濮撳悕錛"+name+"錛涘﹀彿錛"+num,20,30);x0dx0a }x0dx0a}x0dx0ax0dx0a鐩稿簲鐨刪tml鏂囦歡x0dx0ax0dx0ax0dx0ax0dx0ax0dx0ax0dx0a