Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
WelcomeCanvas.java
Package: Communication.rar [view]
Upload User: anders
Upload Date: 2022-07-15
Package Size: 376k
Code Size: 1k
Category:
J2ME
Development Platform:
Java
- package phoneLeter;
- import javax.microedition.lcdui.Canvas;
- import javax.microedition.lcdui.Command;
- import javax.microedition.lcdui.CommandListener;
- import javax.microedition.lcdui.Displayable;
- import javax.microedition.lcdui.Graphics;
- import javax.microedition.lcdui.Font;
- //欢迎界面
- 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);
- }
- protected void paint(Graphics arg0) {
- // TODO Auto-generated method stub
- String str="欢迎光临";
- arg0.setFont(Font.getFont(Font.FACE_SYSTEM,Font.STYLE_BOLD,Font.SIZE_LARGE));
- arg0.setColor(255,0,0);
- arg0.drawString(str,this.getWidth()/2,50,Graphics.TOP|Graphics.HCENTER);
- }
- public void commandAction(Command arg0, Displayable arg1) {
- if(arg0==cmdPhone)
- {
- pm.changeInterface("phoneList");
- }
- else if(arg0==cmdExit)
- {
- pm.notifyDestroyed();
- }
- }
- }