applet1.java~8~

来自「是用java开发的一些程序原代码 是用java开发的一些程序原代码」· JAVA~8~ 代码 · 共 53 行

JAVA~8~
53
字号
package ex14_03;import java.awt.*;import java.awt.event.*;import java.applet.*;public class Applet1 extends Applet {  boolean isStandalone = false;  AudioClip drip;  Button button1 = new Button();  /**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();    }    drip=getAudioClip(getCodeBase(),"into.au");  }  /**Component initialization*/  private void jbInit() throws Exception {    button1.setLabel("button1");    button1.addActionListener(new java.awt.event.ActionListener() {      public void actionPerformed(ActionEvent e) {        button1_actionPerformed(e);      }    });    this.add(button1, null);  }  /**Get Applet information*/  public String getAppletInfo() {    return "Applet Information";  }  /**Get parameter info*/  public String[][] getParameterInfo() {    return null;  }  void button1_actionPerformed(ActionEvent e) {    drip.play();  }}

⌨️ 快捷键说明

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