日期:2014-05-18 浏览次数:20685 次
import java.awt.Frame;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.Toolkit;
import java.net.MalformedURLException;
import java.net.URL;
public class MainFun implements Runnable
{
static Graphics g=null;
static Frame f=new Frame();
static Image im=null;
public static void main(String args[])
{
f.setSize(300,300);
f.setVisible(true);
// Image im=null;
for(int i=0;i<30;i++)
{
try {
URL url=new URL("http://passport.huanqiu.com/user.php?a=secc&code=e4d59d388399be953bd37aa476fe8321710");
im=Toolkit.getDefaultToolkit().getImage(url);
} catch (MalformedURLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
g=f.getGraphics();
}
MainFun mf = new MainFun();
mf.run();
}
@Override
public void run() {
// TODO Auto-generated method stub
while(true)
{
g.drawImage(im, 0, 0, 100, 100, f);
}
}
}