请编写一个Applet,在其窗口
import t。*;
import t。event。*;
import java。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 ? tPro...全部
import t。*;
import t。event。*;
import java。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);
}
}。收起