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

📄 form2.java

📁 一个j2me手机上两个窗体互换的源代码新手身上穿的
💻 JAVA
字号:
import java.io.IOException;

import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Displayable;
import javax.microedition.lcdui.Form;
import javax.microedition.lcdui.Image;


public class Form2 extends Form implements CommandListener{

	
	Command before,next;
	Image img;
	
	public Form2(String title) {
		super(title);
		
		before=new Command("上一页",Command.BACK,1);
		next=new Command("下一页",Command.OK,2);
		
		try {
			img=Image.createImage("/2.png");
		} catch (IOException e) {
			e.printStackTrace();
		}
		
		append(img);
		
		addCommand(before);
		addCommand(next);
		
		setCommandListener(this);
	}

	public void commandAction(Command c, Displayable d) {
		if(c.equals(before))
		{
			FormMIDlet.fm.showForm1();
		}
		
	}

}

⌨️ 快捷键说明

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