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

📄 mydatefield.java

📁 j2me简单实例,j2me教程加源码,希望大家喜欢
💻 JAVA
字号:
package com.j2medev.httpme.view;

import java.util.Date;
import javax.microedition.lcdui.DateField;

/**
 * MyDateField is the subclass of javax.microedition.lcdui.DateField,it add a field name so that 
 * FormUtil can collect the data in MyDateField.you can get the date in String style by invoke getDateByString().
 *
 * @author mingjava
 * @version 0.1 05/06/2006
 * @since httpme 0.1
 */
public class MyDateField extends DateField {
    
    private String fieldName = "";
    /** Creates a new instance of MyDateField */
    public MyDateField(String _label,int _mode,String _fieldName) {
        super(_label,_mode);
        this.setFieldName(_fieldName);
    }
    /**
     * get the field name of MyDateField
     * @return a string the field name 
     */
    public String getFieldName() {
        return fieldName;
    }
    /**
     * set the field name of MyDateField
     * @param fieldName the field name
     *
     */
    public void setFieldName(String fieldName) {
        this.fieldName = fieldName;
    }
    
    /**
     * get the date from MyDateField
     * @return a string represent the date,in fact it's a String Wrapper of long value
     */
    public String getDateByString(){
        return String.valueOf(getDate().getTime());
    }
}

⌨️ 快捷键说明

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