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

📄 mainmenuui.java

📁 <j2me 开发精解> 詹建光著 里所有的源码。对J2me的开发相当有帮助
💻 JAVA
字号:
/*
 * MainMenuUI.java
 *
 * Created on 2005年11月1日, 下午5:00
 *
 * To change this template, choose Tools | Options and locate the template under
 * the Source Creation and Management node. Right-click the template and choose
 * Open. You can then make changes to the template in the Source Editor.
 */

package com.j2medev.ch5.post.ui;

import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Displayable;
import javax.microedition.lcdui.List;

/**
 *
 * @author Administrator
 */
public class MainMenuUI extends List implements CommandListener {
    
    private UIController controller = null;
    /** Creates a new instance of MainMenuUI */
    public MainMenuUI(UIController controller) {
        super("主菜单",List.IMPLICIT);
        this.controller = controller;
        this.append("发表文章", null);
        this.append("阅读文章", null);
        this.setCommandListener(this);
    }
    
    public void commandAction(Command cmd,Displayable displayable){
        if(cmd == List.SELECT_COMMAND){
            String label = this.getString(getSelectedIndex());
            if(label.equals("发表文章")){
                controller.handleEvent(UIController.EventID.MAIN_POST_ARTICLE, null);
            }
        }
    }
}

⌨️ 快捷键说明

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