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

📄 mainui.java

📁 手机获取网页源代码
💻 JAVA
字号:
/*
 * MainUI.java
 *
 * Created on 2006年9月4日, 下午9:23
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package com.j2me.networld.connection;

import javax.microedition.lcdui.*;

/**
 *
 * @author DONGHOME
 */
public class MainUI extends Form
        implements CommandListener
{
    private NWC_MIDlet midlet = null;
    private TextField address = new TextField("Address:", "http://www.baidu.com",
            100, TextField.ANY);
    private static final Command connectCmd = new Command("Connect", Command.OK, 1);
    private static final Command exitCmd = new Command("Exit", Command.EXIT, 0);

    /** Creates a new instance of MainUI */
    public MainUI(NWC_MIDlet midlet)
    {
        super("NetWorld Connect");
        this.midlet = midlet;
        this.append(address);
        this.addCommand(connectCmd);
        this.addCommand(exitCmd);
        this.setCommandListener(this);
    }

    public void commandAction(Command cmd, Displayable dis)
    {
        if(cmd == connectCmd)
        {
            Thread connectThread = new Thread(
                    new ConnectThread(this.midlet, address.getString()));
            connectThread.start();
        }
        else if(cmd == exitCmd)
        {
            this.midlet.exitApp();
        }
    }
}

⌨️ 快捷键说明

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