applet1.java

来自「使用socket通信的demo.」· Java 代码 · 共 52 行

JAVA
52
字号
package aa;import java.awt.*;import java.awt.event.*;import java.applet.*;public class Applet1 extends Applet {  private boolean isStandalone = false;  String hw;  //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 Applet1() {  }  //Initialize the applet  public void init() {    try {      jbInit();    }    catch(Exception e) {      e.printStackTrace();    }  }  //Component initialization  private void jbInit() throws Exception {    hw=getParameter("hw");  }  //Start the applet  public void start() {  }  //Stop the applet  public void stop() {  }  //Destroy the applet  public void destroy() {  }  //Get Applet information  public String getAppletInfo() {    return "Applet Information";  }  //Get parameter info  public String[][] getParameterInfo() {    return null;  }  public void paint(Graphics g){    g.drawString(hw,50,25);  }}

⌨️ 快捷键说明

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