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

📄 downloadform.java.svn-base

📁 测试工具
💻 SVN-BASE
字号:
import javax.microedition.lcdui.*;
import javax.microedition.io.*;
import javax.microedition.midlet.*;
import java.io.*;
import java.util.*;


/**
 * Allow a user to enter a single text input field
 *
 */
public class DownloadForm extends javax.microedition.lcdui.Form
    implements CommandListener {
    /**
     *
     */

    Testlet app;
    TextField textField;
    private Command done = new Command("确定", Command.OK, 1);
    private Command exit = new Command("",Command.CANCEL,2 );

    /**
     * This constructor creates new BaseDemo with the given title & creates
     * the standard commands for the demos.
     */
    public DownloadForm (String title, Testlet app) {
        super(title);
					this.app = app;
				  setCommandListener(this) ;
					//setItemStateListener(new StateChangeListener (done, this));
					textField = new TextField("下载地址", "http://61.153.21.82:8888/device/d.wml", 100, TextField.ANY );
					this.append( textField );
					addCommand(done);
					addCommand(exit);
				
    }

     /*
     * Indicates that a command event has occurred. 
     */
    public void commandAction(Command c, Displayable d)  {
    	
    	     if ( c == exit )
				    app.returnMainList();
				   else if ( c == done )
				   {
				   		try
				   	  {
				   	  	  app.platformRequest( textField.getString() );
				   	  }
				   	  catch( Exception e ){}
				   } 
			
    }

    
    
}





⌨️ 快捷键说明

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