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

📄 postarticleui.java

📁 <j2me 开发精解> 詹建光著 里所有的源码。对J2me的开发相当有帮助
💻 JAVA
字号:
/*
 * PostArticleUI.java
 *
 * Created on 2005年11月1日, 下午2:28
 *
 * 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.Form;
import javax.microedition.lcdui.TextField;
import com.j2medev.ch5.post.*;

/**
 *
 * @author Administrator
 */
public class PostArticleUI extends Form implements CommandListener {
    
    private UIController controller = null;
    private TextField title = new TextField("文章标题:", "", 20, TextField.ANY);
    private TextField author = new TextField("作  者:", "", 20, TextField.ANY);
    public static final Command nextCommand = new Command("输入内容",Command.OK,1);
    /** Creates a new instance of PostArticleUI */
    public PostArticleUI(UIController controller) {
        
        super("发表文章");
        this.controller = controller;
        this.append(title);
        this.append(author);
        this.addCommand(nextCommand);
        this.setCommandListener(this);
   
    }
    
    public void commandAction(Command cmd,Displayable displayable){
        if(cmd == nextCommand){
            String a_title = title.getString();
            String a_author = author.getString();
            controller.handleEvent(UIController.EventID.INPUT_CONTENT, new Object[]{a_title,a_author});
        }
    }
    
}

⌨️ 快捷键说明

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