downloadform.java.svn-base

来自「测试工具」· SVN-BASE 代码 · 共 65 行

SVN-BASE
65
字号
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 + =
减小字号Ctrl + -
显示快捷键?