import java.awt.*;
import java.applet.*;public class ccc extends Applet
{
TextField f;
change s;
public void init()
{
f = new TextField();
add(f);
s = new change(f);
s.start();
}
public void paint(Graphics g)
{
g.drawString("Hello World", 20, 20);
}
}
class change extends Thread
{
int i = 0;
TextField tf;
change(TextField s)
{
tf = s;
}
public void run()
{
boolean b;
b = true;
while (b)
{
if (i>500)
{
b = false;
}
i = i+1;
tf.setText(Integer.toString(i));
System.out.println(Integer.toString(i));
}
}
}
import java.applet.*;public class ccc extends Applet
{
TextField f;
change s;
public void init()
{
f = new TextField();
add(f);
s = new change(f);
s.start();
}
public void paint(Graphics g)
{
g.drawString("Hello World", 20, 20);
}
}
class change extends Thread
{
int i = 0;
TextField tf;
change(TextField s)
{
tf = s;
}
public void run()
{
boolean b;
b = true;
while (b)
{
if (i>500)
{
b = false;
}
i = i+1;
tf.setText(Integer.toString(i));
System.out.println(Integer.toString(i));
}
}
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货