⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 helloworld.java

📁 <j2me 开发精解> 詹建光著 里所有的源码。对J2me的开发相当有帮助
💻 JAVA
字号:
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;

public class HelloWorld extends MIDlet implements CommandListener {

    private Display display;
    public static final Command exitCommand = new Command("退出",Command.EXIT,1);

    public HelloWorld() {
        
    }

    public void startApp() {
    	if(display == null)
    	{
    		display = Display.getDisplay(this);
        }
        TextBox t = new TextBox("Netbeans", "出色的Java开发工具", 256, 0);
        display.setCurrent(t);
    }

    public void pauseApp() {
    }

    public void destroyApp(boolean unconditional) {

    }

    public void commandAction(Command cmd,Displayable displayable){
	if(cmd == exitCommand){
		destroyApp(false);
		notifyDestroyed();
	}
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -