backform.java

来自「情话宝典」· Java 代码 · 共 32 行

JAVA
32
字号
import javax.microedition.lcdui.*;

public class BackForm extends Form implements CommandListener{
	public BackForm( Display display, Displayable displayable, String s ){
		super( s );
		this.display = display;
		this.displayable = displayable;

		commandBack = new Command( "主菜单", Command.SCREEN, 1 );
		addCommand( commandBack );
		setCommandListener( this );
	}

	public void commandAction( Command c, Displayable s ){
		if( c.equals(commandBack) ){
			display.setCurrent( displayable );
		}
	}

	public void setText( String s ){
		StringItem item = new StringItem( null, s );
		append( item );
	}

	public void show(){
		display.setCurrent( this );
	}

	private Command commandBack;
	private Display display;
	private Displayable displayable;
}

⌨️ 快捷键说明

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