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

📄 detailinfoui.java

📁 基于j2me的电话本基于j2me的电话本
💻 JAVA
字号:
package com.hziee.phone_book.ui;


import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Displayable;
import javax.microedition.lcdui.List;
import com.hziee.phone_book.model.Account;
public class DetailInfoUI extends List implements CommandListener
{

    private UIController uicontroller;
    private int listNum = 0;
    public static final Command backCommand = new Command("返回", Command.BACK, 1);

    public DetailInfoUI(UIController uicontroller)
    {
        super(Title.DETAIL_INFO, List.IMPLICIT);
        this.uicontroller = uicontroller;
        this.addCommand(backCommand);
        this.setCommandListener(this);
    }

    public void init(Account account)
    {
        if (listNum > 0)
        {
            deleteAll(listNum);
        }
        this.append(account.getUserName(), null);
        this.append(account.getMobilePhone(), null);
        String email = account.getEmail();
       
        if (email.length()!=0)
        {
            this.append(email, null);
            System.out.println(email.length());
        }
        String phone = account.getPhone();
        if (phone.length()!=0)
        {
            this.append(phone, null);
            System.out.println(phone+"is");
        }
        
        listNum = size();

    }

    public void deleteAll(int listNum)
    {
        for (int i = listNum - 1; i >= 0; i--)
        {
            this.delete(i);
        }
    }

    /*
     * (non-Javadoc)
     * 
     * @see javax.microedition.lcdui.CommandListener#commandAction(javax.microedition.lcdui.Command,
     *      javax.microedition.lcdui.Displayable)
     */
    public void commandAction(Command arg0, Displayable arg1)
    {
        // TODO Auto-generated method stub
        if (arg0 == backCommand)
        {
            uicontroller
                    .handleEvent(UIController.EventID.EVENT_DETAIL_BACK_LIST);
        }

    }

}

⌨️ 快捷键说明

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