📄 au_player.java
字号:
package au_player;import java.awt.*;import java.awt.event.*;import java.applet.*;public class AU_Player extends Applet { private boolean isStandalone = false; AudioClip music; Button button1=new Button(); Button button2=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 AU_Player() { } //Initialize the applet public void init() { try { jbInit(); } catch(Exception e) { e.printStackTrace(); } } //Component initialization private void jbInit() throws Exception { music=this.getAudioClip(this.getCodeBase(),"a.au"); button2.setLabel("\u505C\u6B62"); button2.addActionListener(new Applet1_button2_actionAdapter(this)); button1.setLabel("\u64AD\u653E"); button1.addActionListener(new Applet1_button1_actionAdapter(this)); this.add(button1,null); this.add(button2,null); } //Get Applet information public String getAppletInfo() { return "Applet Information"; } //Get parameter info public String[][] getParameterInfo() { return null; } void button1_actionPerformed(ActionEvent e) { music.loop(); } void button2_actionPerformed(ActionEvent e) { music.stop(); }}class Applet1_button1_actionAdapter implements java.awt.event.ActionListener { AU_Player adaptee; Applet1_button1_actionAdapter(AU_Player adaptee) { this.adaptee = adaptee; } public void actionPerformed(ActionEvent e) { adaptee.button1_actionPerformed(e); }}class Applet1_button2_actionAdapter implements java.awt.event.ActionListener { AU_Player adaptee; Applet1_button2_actionAdapter(AU_Player adaptee) { this.adaptee = adaptee; } public void actionPerformed(ActionEvent e) { adaptee.button2_actionPerformed(e); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -