论坛首页 入门技术论坛

关于J2ME 多Form程序在PPC中显示的问题

浏览 1532 次
该帖已经被评为新手帖
作者 正文
   发表时间:2008-06-11  
在做J2ME程序,在PPC中显示出现了问题。
如果 在一个Midlet中构造多个form, 在PPC(测试使用的是华硕牌子的PPC)显示的时候会在程序屏幕上方出现个过滤条,好像用用来过滤显示的屏幕的,这个过滤条挡住了J2me程序的内容,有没有遇到类似问题的同行,请教下是如何解决啊, 附程序示例代码:

public class PPCTest extends MIDlet implements CommandListener {
	private final Command tableCommand = new Command("Table", Command.SCREEN, 1);
	private final Command inputCommand = new Command("Input", Command.SCREEN, 1);
	private final Command tabItemCommand = new Command("TabItem",
			Command.SCREEN, 1);
	private final Command tabFormCommand = new Command("tabForm",
			Command.SCREEN, 1);
	private final Command imageCommand = new Command("Image", Command.SCREEN, 1);
	private final Command containerCommand = new Command("Container",
			Command.SCREEN, 1);
	private final Command otherItemCommand = new Command("OtherItem",
			Command.SCREEN, 1);
	private final Command menuCommand = new Command("Menu", Command.SCREEN, 1);
	private final Command popupCommand = new Command("Popup", Command.SCREEN, 1);
	private final Command exitCommand = new Command("Exit", Command.EXIT, 10);

	private Form mainScreen;
	private Display display;


	public PPCTest() {
		// TODO Auto-generated constructor stub
	}

	protected void destroyApp(boolean arg0) throws MIDletStateChangeException {
		// TODO Auto-generated method stub

	}

	protected void pauseApp() {
		// TODO Auto-generated method stub

	}
	protected Form createInputForm() {
		Form form = new Form("Input", StyleSheet.formStyle);
		addCommand(form);
		return form;
	}

	protected Form createTabItemForm() {
		Form form = new Form("TabItem", StyleSheet.formStyle);
		 
		addCommand(form);
		return form;
	}

	protected void startApp() throws MIDletStateChangeException {
		mainScreen = createInputForm();
		this.display = Display.getDisplay(this);
		this.display.setCurrent(mainScreen);
	}
	protected void addCommand(Screen form) {
		form.addCommand(this.containerCommand);
		form.addCommand(this.imageCommand);
		form.addCommand(this.inputCommand);
		form.addCommand(this.otherItemCommand);
		form.addCommand(this.tabFormCommand);
		form.addCommand(this.tabItemCommand);
		form.addCommand(this.tableCommand);
		form.addCommand(this.menuCommand);
		form.addCommand(this.popupCommand);
		form.addCommand(this.exitCommand);
		form.setCommandListener(this);
	}

	public void commandAction(Command arg0, Displayable arg1) {
		if (arg0 == this.inputCommand) {
			mainScreen = null;
			mainScreen = createInputForm();
			this.display.setCurrent(mainScreen);
			//showAlert();
		} else if (arg0 == this.tabItemCommand) {
			mainScreen = null;
			mainScreen = createTabItemForm();
			this.display.setCurrent(mainScreen);
		} else if (arg0 == this.exitCommand) {
			notifyDestroyed();
		} 
	}

}


另外Form和Screen不是标准的,是使用Polish的实现。
论坛首页 入门技术版

跳转论坛:
Global site tag (gtag.js) - Google Analytics