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

📄 applet1.java~5~

📁 基于Java的物流管理系统的开发与应用
💻 JAVA~5~
字号:
package untitled5;

import java.awt.*;
import java.awt.event.*;
import java.applet.*;
import javax.swing.*;
import java.net.*;
/**
 * <p>Title: </p>
 * <p>Description: </p>
 * <p>Copyright: Copyright (c) 2003</p>
 * <p>Company: </p>
 * @author not attributable
 * @version 1.0
 */

public class Applet1 extends Applet {
  private boolean isStandalone = false;
  JButton jButton1 = new JButton();
  //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 {
    jButton1.setText("jButton1");
    jButton1.addActionListener(new Applet1_jButton1_actionAdapter(this));
    this.add(jButton1, null);
  }
  //Get Applet information
  public String getAppletInfo() {
    return "Applet Information";
  }
  //Get parameter info
  public String[][] getParameterInfo() {
    return null;
  }

  void jButton1_actionPerformed(ActionEvent e) {
    try{
      this.getAppletContext().showDocument(new URL("http://www.sina.com.cn"));
    }catch(Exception err){
      err.printStackTrace() ;
    }
  }
}

class Applet1_jButton1_actionAdapter implements java.awt.event.ActionListener {
  Applet1 adaptee;

  Applet1_jButton1_actionAdapter(Applet1 adaptee) {
    this.adaptee = adaptee;
  }
  public void actionPerformed(ActionEvent e) {
    adaptee.jButton1_actionPerformed(e);
  }
}

⌨️ 快捷键说明

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