?? appletshow.java~7~
字號(hào):
package review;
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
public class AppletShow extends Applet implements Runnable{
boolean isStandalone = false;
BorderLayout borderLayout1 = new BorderLayout();
private String[] ss={"ACCP3.0","BNET1.0","JUNIOR1.0","BTEST1.0"};
private Color[] colors={Color.red,Color.blue,Color.black,Color.ORANGE};
int current=0;
//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 AppletShow() {
}
//Initialize the applet
public void init() {
try {
jbInit();
} catch (Exception e) {
e.printStackTrace();
}
}
//Component initialization
private void jbInit() throws Exception {
}
//Start the applet
public void start() {
}
public void paint(Graphics g){
g.clearRect(0,0,400,300);
g.setFont(new Font("宋體",1,30));
g.setColor(colors[current]);
g.drawString(ss[current],180,140);
}
//Stop the applet
public void stop() {
}
//Destroy the applet
public void destroy() {
}
//Get Applet information
public String getAppletInfo() {
return "Applet Information";
}
//Get parameter info
public String[][] getParameterInfo() {
return null;
}
public void run(){
do{
try{
Thread.sleep(1000);
}catch(Exception e){
e.printStackTrace();
}
current++;
if(current>3) current=0;
repaint();
}while(true);
}
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -