📄 img.java
字号:
package img;import java.awt.*;import java.awt.event.*;import java.applet.*;/** * <p>Title: </p> * <p>Description: </p> * <p>Copyright: Copyright (c) 2002</p> * <p>Company: </p> * @author unascribed * @version 1.0 */public class img extends Applet { Image thisimg; 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 img() { } //Initialize the applet public void init() { thisimg=getImage(getCodeBase(),"connect.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; }public void paint(Graphics g){int x=thisimg.getWidth(this);int y=thisimg.getHeight(this);g.drawImage(thisimg,(200-(int)(x/2)),(200-(int)(y/2)),x,y,this);} }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -