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

📄 dynamicform.java

📁 手机上传图片到服务器 访问web地址 不错的小程序
💻 JAVA
字号:
package com;
/*
 * DynamicForm.java
 *
 * Created on 2007年4月13日, 下午1:33
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

/**
 *
 * @author chenzs
 */
import javax.microedition.lcdui.*;

public abstract class DynamicForm extends Form implements Runnable{
    
    StringItem label;
    protected boolean isFinished;
    protected String strLabel;
    protected int count = 0;
    /** Creates a new instance of DynamicForm */
    public DynamicForm(String title) {
        super(title);
        strLabel = ">";
        label = new StringItem("wait", strLabel);
     //   append(label);
    }
    
    public void start(){
        append(label);
        Thread thread = new Thread( this );
        thread.start();
    }
    
    public void stop(){
        isFinished = true;
    }
    
    public void run(){
       while(!isFinished){
         try {
            Thread.sleep(800);
         } catch (InterruptedException e) {
            // ignore
         }
         if(++count >= 30){
               strLabel = ">";
               count = 0;
           }                
           else
               strLabel += ">";
           label.setText(strLabel);
        }
    }
    
    //抽象的网络连接处理函数
     public abstract void getHttpConnection();
    
     class HttpConnThread extends Thread{
        public HttpConnThread(){
            
        }
        
        public void run(){
            try{
                sleep(100);         
            }
            catch(InterruptedException e){
                
            }
            getHttpConnection();
        }
          
    }//~end class
   
}

⌨️ 快捷键说明

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