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

📄 check_color.java

📁 J2ME移动设备程序设计代码 是头几张的 代码 等
💻 JAVA
字号:
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;

public class Check_Color extends MIDlet implements CommandListener{
	private Display display;
	private TextBox tb;
	Command cmd_Exit;
	Command cmd_Color;
	
	public Check_Color(){
		display=Display.getDisplay(this);
		tb = new TextBox("Check Colors of the Device","Check Color",50,0);
		cmd_Exit = new Command("Exit",Command.EXIT,1);
		cmd_Color= new Command("check",Command.SCREEN,1);
		tb.addCommand(cmd_Exit);
		tb.addCommand(cmd_Color);
		tb.setCommandListener(this);
	}
	public void startApp(){
		display.setCurrent(tb);
	}
	
	public void pauseApp(){
		
	}
	
	public void destroyApp(boolean unconditional){
		
	}
	
	public void commandAction(Command c,Displayable d){
		if(c==cmd_Exit){
			destroyApp(false);
			notifyDestroyed();
		}
		if(c==cmd_Color){
			if(display.isColor()){
				tb.setString("the device is  "+display.numColors()+"  colors");
				display.setCurrent(tb);
			}
			else{
				tb.setString("the device is  "+display.numColors()+"  graylevels");	
				display.setCurrent(tb);
			}	
		}
	}
}

⌨️ 快捷键说明

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