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

📄 mainmenu.java

📁 j2me手机图书阅读器
💻 JAVA
字号:
/********************************************************************
 * 
 * 版权说明,此程序仅供学习参考。不能用于商业
 * 
 ********************************************************************/
package org.pook.main;


import java.util.Vector;

import javax.microedition.lcdui.Image;

import org.pook.Pook;
import org.pook.Resources;
import org.pook.log.Log;
import org.pook.ui.Command;
import org.pook.ui.IconMenu;
import org.pook.ui.Menu;
import org.pook.ui.event.CommandListener;
import org.pook.ui.form.MenuPanel;

 
/**
 * <b>类名:MainMenu.java</b> </br> 编写日期: 2006-9-15 <br/> 程序功能描述: <br/> Demo:
 * <br/> Bug: <br/>
 * 
 * 程序变更日期 :<br/> 变更作者 :<br/> 变更说明 :<br/>
 * 
 * @author wuhua </br> <a href="mailto:rrq12345@163.com">rrq12345@163.com</a>
 */
public class MainMenu extends MenuPanel implements CommandListener {
	private static Log log = Log.getLog("MainMenu");

	private Command ok = new Command("进入", Command.LEFT, Command.FIRST_PRIORITY);

 

	/**
	 * 图标Icon
	 */
	private Image[] icons = { Resources.MY_BOOK,
			Resources.NET_BOOK , Resources.HELP,
			Resources.ABOUT, Resources.EXIT};
 
 

	public Menu menu;

	private BookItem bi;
 
 
	public MainMenu() {
		 
		initContenxt();
		this.addCommand(ok);
	 
		this.setSoftButtonListener(this);
		this.append(menu);		
		this.setSoftButtonStyle(0x0071BD,0xFFFFFF);
		
		setTimer(Pook.getTimerPart());
	}

	private void initContenxt() {
		menu = new IconMenu(icons, Resources.ARROW);
		this.append(menu);
		
		bi = new BookItem();
		
	}

	 

	public void commandAction(Command cmd) {
		if (cmd == ok) {
			openItemMenu();
		} else {
			 
		}

	}

 

	 

	//打开子菜单
	private void openItemMenu() {
		if (this.menu.getSelectIndex() == 0) {
			 Pook.openForm(bi);
			 Resources.openRoot();
			 bi.addBookList((Vector) Resources.FILE_LIST.elementAt(0));
		} else if (this.menu.getSelectIndex() == 1) {
			Pook.openMessageDialog("提示","此功能暂为实现!请耐心等待!",this);
		 
		} else if (this.menu.getSelectIndex() == 2) {
			 
		} else if (this.menu.getSelectIndex() == 3) {
			Pook.openMessageDialog("帮助","中的思发的第三弗萨多幅速度发的三分级第三分散地方做的发" +
					"的发送地方斯蒂芬" +
					"第三方所得ff速度弗萨多幅dsf" +
					"毒素发斯蒂芬sdf毒素发" +
					"cjxv斯蒂芬" +
					"dfew;weqdasd速度asd" +
					"中的思发的第三弗萨多幅速度发的三分级第三分散地方做的发" +
					"中的思发的第三弗萨多幅速度发的三分级第三分散地方做的发" +
					"中的思发的第三弗萨多幅速度发的三分级第三分散地方做的发" +
					"中的思发的第三弗萨多幅速度发的三分级第三分散地方做的发" +
					"中的思发的第三弗萨多幅速度发的三分级第三分散地方做的发" +
					"", this); 
		} else if (this.menu.getSelectIndex() == 4) {
			Pook.exit();
		} 
	}

	 

 

}

⌨️ 快捷键说明

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