把我的问题解释下吧 resize(400,400);
还有我怎么就运行不起来呢,老说我在APPLET界面里没初始化
子非鱼,安知鱼之江湖?子非我,安知我之功夫 http://20681.
把我的问题解释下吧 resize(400,400);
还有我怎么就运行不起来呢,老说我在APPLET界面里没初始化
/*<applet code="Image001.class"width=200 height=200>
</applet>
*/
import java.util.*;
import javax.swing.*;
import java.awt.*;
public class Image001 extends JApplet implements Runnable{
ImageIcon pic1;
double j=2;
int i=1;
int k=200;
public void init(){
pic1=new ImageIcon("D:/myjava/tupian/avril.gif");
resize(400,400);
}
public void run(){
System.out.println("");
}
public void paint (Graphics g){
super.paint(g);
pic1.paintIcon(this,g,i,50);
while(j>1) {
j++;i++;
super.paint(g);
pic1.paintIcon(this,g,i,50);
if(j%5==0)
{
if(i>200) {super.paint(g) ; pic1.paintIcon(this,g,k,50) ;k--;if(k<=0) {i=1;k=200;}}
try
{Thread.sleep(50);}
catch(Exception e) {}}
if(j>10000) j=1;}
}
}