µ±Ç°Î»Ö㺠´úÂëÃÔ >> JavaÏà¹Ø >> ΪʲôͼƬ²»ÄÜÏÔʾÄØ
  Ïêϸ½â¾ö·½°¸

ΪʲôͼƬ²»ÄÜÏÔʾÄØ

Èȶȣº725   ·¢²¼Ê±¼ä£º2006-03-24 23:16:00.0
ΪʲôͼƬ²»ÄÜÏÔʾÄØ
/*<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=1;
int i=10;
public void init(){
pic1=new ImageIcon("D:/myjava/tupian/avril.gif");
resize(400,400);
}
public void run(){

System.out.println("ceshiceshi");
}
public void paint (Graphics g){
while(j>1) {
i++;
pic1.paintIcon(this,g,i,50);
if(j%5==0)
{try
{Thread.sleep(1000);}
catch(Exception e) {}}
}
if(j>10000) j=1;
}


}
ΪʲôͼƬ²»ÄܳöÀ´ÄØ
ËÑË÷¸ü¶àÏà¹ØµÄ½â¾ö·½°¸: public  import  void  java  

----------------½â¾ö·½°¸--------------------------------------------------------
°ÑͼƬ·ÅÔÚ.javaÎļþµÄËùÔÚĿ¼ÊÔÊÔ¿´
----------------½â¾ö·½°¸--------------------------------------------------------

ÕâÑùµ±È»ÊÇÏÔʾ²»Á˵ģ¬ÄãµÄj¾ÍÊǵÈÓÚ1£¬¿ÉÊÇÄãÈ´ÒªËü´óÓÚ1£¬Èç¹ûÄãÏëÏÔʾµÄ»°£¬¿ÉÒÔÕâÑù×ö£º
========================================
/*<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{
Image pic1;

public void init(){
pic1=this.getImage(getCodeBase(),"image.gif");
resize(400,400);
}
public void run(){

System.out.println("ceshiceshi");
}
public void paint (Graphics g){


g.drawImage(pic1,0,0,this);

}


}
ÔÚÕâÀïÈç¹ûÄã°ÑͼƬ·ÅÔÚºÍImage001.classͬһ¸öĿ¼Ï£¬ÉÏÃæÀ¶É«µÄ×Ö¾ÍÊǶԵÄ
µ«ÊÇÈç¹ûÄã°ÑͼƬºÍHTMLÎļþ·ÅÔÚͬһ¸öĿ¼Ï£¬ÉÏÃæÀ¶É«µÄ×Ö¾ÍÒª¸Ä³ÉgetDocumentBase();
Ñø³ÉÁËÕâ¸öÏ°¹ßÒ²ºÜºÃ£¬ÒƵ½ÄÄÀﶼÄÜÔËÐУ¬·ñÔòÄãдһ¸ö¾ø¶ÔµØÖ·£¬±ðÈ˵çÄÔÉϸù±¾Ã»ÓÐÕâ¸öĿ¼£¬Ôõô¿ÉÄÜ¿´µÃµ½ÄãµÄͼƬӴ

[´ËÌù×ÓÒѾ­±»×÷ÕßÓÚ2006-3-25 10:25:10±à¼­¹ý]


----------------½â¾ö·½°¸--------------------------------------------------------

¶ÔÓÚsunÐÅͽ¸øÓèÇ¿ÁҵĸÐл


----------------½â¾ö·½°¸--------------------------------------------------------
  Ïà¹Ø½â¾ö·½°¸