分类：电脑/网络-程序设计-JAVA相关
问题：2、请编写一个Applet，在其窗口中摆放一个按钮和一个标签，当? 
2、请编写一个t，在其窗口中摆放一个按钮和一个标签，当点击按钮时在标签上显示“按钮被点击”。
回答：import  t.*;import  t.event.*;import .applet.*;import javax.swing.*;public class Applet1 extends Applet {  private boolean isStandalone = false;  JButton jButton1 = new JButton();  JLabel jLabel1 = new JLabel();   public String getParameter(String key, String def) {    return isStandalone ?  tProperty(key, def) :      (getParameter(key) != null ? getParameter(key) : def);  }  //Construct the applet  public Applet1() {  }  //Initialize the applet  public void init() {    try {      jbInit();    }    catch(Exception e) {       intStackTrace();    }  }  //Component initialization  private void jbInit() throws Exception {     tBounds(new Rectangle(100, 177, 82, 29));     tText("显示");     dActionListener(new Applet1_jButton1_actionAdapter(this));     tLayout(null);     tText(" ");     tBounds(new Rectangle(69, 85, 147, 44));     d(jButton1, null);     d(jLabel1, null);  }  //Get Applet information  public String getAppletInfo() {    return "Applet Information";  }  //Get parameter info  public String[][] getParameterInfo() {    return null;  }  void jButton1_actionPerformed(ActionEvent e) {     tText("按钮被点击");  }}class Applet1_jButton1_actionAdapter implements  t.event.ActionListener {  Applet1 adaptee;  Applet1_jButton1_actionAdapter(Applet1 adaptee) {     aptee = adaptee;  }  public void actionPerformed(ActionEvent e) {    adaptee.jButton1_actionPerformed(e);  }}