?? welcomecanvas.java
字號:
/**源代碼由程序員聯合開發網(www.pudn.com)會員"周潤發"收集、整理、重新編輯
*Email: ql_chuanzhang@tom.com
*QQ號:1103798882
*歡迎大家與我聯系互相交流學習
**/
package rms_cn;
import javax.microedition.lcdui.Canvas;
import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Displayable;
import javax.microedition.lcdui.Font;
import javax.microedition.lcdui.Graphics;
public class Welcomecanvas extends Canvas implements CommandListener{
private Command cmdPhone = new Command("電話本",Command.SCREEN,1);
private Command cmdExit = new Command("退出",Command.EXIT,1);
private PhoneMIDlet pm;
public Welcomecanvas(PhoneMIDlet pm){
this.pm = pm;
this.addCommand(cmdPhone);
this.addCommand(cmdExit);
this.setCommandListener(this);
}
public void commandAction(Command c,Displayable d){
if(c==cmdPhone){
pm.changeInterface("PhoneList");
}
else if(c==cmdExit){
pm.notifyDestroyed();
}
}
public void paint(Graphics g){
String str = "歡迎光臨";
g.setColor(0, 0, 0);
g.fillRect(0, 0, this.getWidth(), this.getHeight());
g.setFont(Font.getFont(Font.FACE_SYSTEM,Font.STYLE_BOLD,Font.SIZE_LARGE));
g.setColor(255, 0, 0);
g.drawString(str, this.getWidth()/2, this.getHeight()/4, Graphics.TOP|Graphics.HCENTER);
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -