?? applet1.java~3~
字號:
package exp3;
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
import java.awt.Panel;
/**
* <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;
//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() {
Panel p1=new Panel();
p1.setBackground(Color.yellow);
p1.add(new Button("button in panel1"))
p1.add(new TextField("in panel1"));
add(p1);
Panel p2=new Panel();
p2.setBackground(Color.green);
p2.add(new Button("button in panel2"));
p2.add(new TextField("in panel2"));
add(p2);
try {
jbInit();
}
catch(Exception e) {
e.printStackTrace();
}
}
//Component initialization
private void jbInit() throws Exception {
}
//Get Applet information
public String getAppletInfo() {
return "Applet Information";
}
//Get parameter info
public String[][] getParameterInfo() {
return null;
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -