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

📄 changeimg.java~20~

📁 Jbuilder100个例子 都是经典例子 对大家学习Jbuilder非常有帮助
💻 JAVA~20~
字号:
package untitled1;import java.awt.*;import java.awt.event.*;import java.applet.*;public class changeImg extends java.applet.Applet implements Runnable{  Image myImg;  boolean flag = true;  double i = 0.1;  Thread runner;  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);  }  public void start(){   if(runner==null){      runner=new Thread(this);      runner.start();      }  }  public void stop(){   if(runner!=null){       runner.stop();       runner=null;   }  }   public void run(){      while(true){        repaint();        try{           Thread.sleep(200); }        catch(InterruptedException e){}      }   }   public void paint(Graphics g){     if (i >= 2.5)        flag = false;     if (i <= 0.1)        flag = true;     if (flag == true)        i += 0.1;     else        i -= 0.1;     int x = myImg.getWidth(this);     int y = myImg.getHeight(this);     g.drawImage(myImg,(150-(int)((x*i)/2)),(150-(int)((y*i)/2)),(int)(x*i),(int)(y*i),this);   }  /**Construct the applet*/  public changeImg() {  }  /**Initialize the applet*/  public void init() {    myImg=getImage(getCodeBase(),"qingchengshan1.jpg");    try {      jbInit();    }    catch(Exception e) {      e.printStackTrace();    }  }  /**Component initialization*/  private void jbInit() throws Exception {  }  /**Get Applet information*/  public String getAppletInfo() {    return "Applet Information";  }  /**Get parameter info*/  public String[][] getParameterInfo() {    return null;  }}

⌨️ 快捷键说明

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