[求助]APPLET转化成应用程序
import java.awt.*;import java.awt.event.*;
import java.applet.*;
public class MangDa extends Applet implements Runnable
{
Thread myThread;
String Zi26="";
int A=97;
String sz[][]=new String[2][5];
public void init()
{
for (int i=0;i<26;i++)
{
Zi26+=(char)(A+i);
}
}
public void start()
{
if (myThread==null)
{
myThread=new Thread(this);
myThread.start();
}
}
public void paint(Graphics g)
{
g.setColor(Color.black);
for (int i=0;i<sz.length;i++)
{
for (int j=0;j<sz[i].length;j++)
{
int zc=(int)(Math.random()*26);
sz[i][j]=Zi26.substring(zc,zc+1);
int x=(int)(getSize().width*Math.random());
g.drawString(sz[i][j],x,50);
}
}
}
public void run()
{
repaint();
}
}