⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 applet2.java

📁 次编程实现打开图象
💻 JAVA
字号:
package tuixiang;import java.awt.*;import java.awt.event.*;import java.applet.*;/** * <p>Title: </p> * <p>Description: </p> * <p>Copyright: Copyright (c) 2004</p> * <p>Company: </p> * @author not attributable * @version 1.0 */public class Applet2 extends Applet {  private boolean isStandalone = false;  //Get a parameter value  public String getParameter(String key, String def) {    return isStandalone ? System.getProperty(key, def) :      (getParameter(key) != null ? getParameter(key) : def);  }  //Construct the applet  public Applet2() {  }  //Initialize the applet  //Component initialization  private void jbInit() throws Exception {  }  //Get Applet information  public String getAppletInfo() {    return "Applet Information";  }  //Get parameter info  public String[][] getParameterInfo() {    return null;  }  Image[] m_Images;  int totalImages=3;  int currentImage=0;  public void init()  { m_Images=new Image[totalImages];    for(int i=0;i<totalImages;i++)      m_Images[i]=getImage(getDocumentBase(),"images\\Image0"+(i+1)+".gif");  }  public void start()  { currentImage=0;  }  public void paint(Graphics g)  {    g.drawImage(m_Images[currentImage],50,50,this);    currentImage=++currentImage%totalImages;    try{ Thread.sleep(50);    }    catch(InterruptedException e)    { showStatus(e.toString());    }    repaint();  }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -