📄 datefield.html
字号:
</TABLE>
<P>
<!-- ============ FIELD DETAIL =========== -->
<A NAME="field_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Field Detail</B></FONT></TD>
</TR>
</TABLE>
<A NAME="DATE"><!-- --></A><H3>
DATE</H3>
<PRE>
public static final int <B>DATE</B></PRE>
<DL>
<DD>Input mode for date information (day, month, year). With this mode this <code>DateField</code> presents and allows only to modify date value. The time information of date object is ignored. <P>Value <code>1</code> is assigned to <code>DATE</code>.</P></DL>
<HR>
<A NAME="TIME"><!-- --></A><H3>
TIME</H3>
<PRE>
public static final int <B>TIME</B></PRE>
<DL>
<DD>Input mode for time information (hours and minutes). With this mode this <code>DateField</code> presents and allows only to modify time. The date components should be set to the "zero epoch" value of January 1, 1970 and should not be accessed. <P>Value <code>2</code> is assigned to <code>TIME</code>.</P></DL>
<HR>
<A NAME="DATE_TIME"><!-- --></A><H3>
DATE_TIME</H3>
<PRE>
public static final int <B>DATE_TIME</B></PRE>
<DL>
<DD>Input mode for date (day, month, year) and time (minutes, hours) information. With this mode this <code>DateField</code> presents and allows to modify both time and date information. <P>Value <code>3</code> is assigned to <code>DATE_TIME</code>.</P></DL>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<A NAME="constructor_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TD>
</TR>
</TABLE>
<A NAME="DateField(java.lang.String, int)"><!-- --></A><H3>
DateField</H3>
<PRE>
public <B>DateField</B>(<A HREF="../../../java/lang/String.html">String</A> label, int mode)</PRE>
<DL>
<DD>Creates a <code>DateField</code> object with the specified label and mode. This call is identical to <code>DateField(label, mode, null)</code>.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>label</CODE> - item label<DD><CODE>mode</CODE> - the input mode, one of <code>DATE</code>, <code>TIME</code> or <code>DATE_TIME</code><DT><B>Throws:</B><DD><CODE><A HREF="../../../java/lang/IllegalArgumentException.html">IllegalArgumentException</A></CODE> - if the input <code>mode's</code> value is invalid</DL>
</DD>
</DL>
<HR>
<A NAME="DateField(java.lang.String, int, java.util.TimeZone)"><!-- --></A><H3>
DateField</H3>
<PRE>
public <B>DateField</B>(<A HREF="../../../java/lang/String.html">String</A> label, int mode, <A HREF="../../../java/util/TimeZone.html">TimeZone</A> timeZone)</PRE>
<DL>
<DD>Creates a date field in which calendar calculations are based on specific <code>TimeZone</code> object and the default calendaring system for the current locale. The value of the <code>DateField</code> is initially in the "uninitialized" state. If <code>timeZone</code> is <code>null</code>, the system's default time zone is used.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>label</CODE> - item label<DD><CODE>mode</CODE> - the input mode, one of <code>DATE</code>, <code>TIME</code> or <code>DATE_TIME</code><DD><CODE>timeZone</CODE> - a specific time zone, or <code>null</code> for the default time zone<DT><B>Throws:</B><DD><CODE><A HREF="../../../java/lang/IllegalArgumentException.html">IllegalArgumentException</A></CODE> - if the input <code>mode's</code> value is invalid</DL>
</DD>
</DL>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Method Detail</B></FONT></TD>
</TR>
</TABLE>
<A NAME="getDate()"><!-- --></A><H3>
getDate</H3>
<PRE>
public <A HREF="../../../java/util/Date.html">Date</A> <B>getDate</B>()</PRE>
<DL>
<DD>Returns date value of this field. Returned value is <code>null</code> if field value is not initialized. The date object is constructed according the rules of locale specific calendaring system and defined time zone. In <code>TIME</code> mode field the date components are set to the "zero epoch" value of January 1, 1970. If a date object that presents time beyond one day from this "zero epoch" then this field is in "not initialized" state and this method returns <code>null</code>. In <code>DATE</code> mode field the time component of the calendar is set to zero when constructing the date object.<DD><DL>
<DT><B>Returns:</B><DD>date object representing time or date depending on input mode<DT><B>See Also: </B><DD><A HREF="../../../javax/microedition/lcdui/DateField.html#setDate(java.util.Date)"><CODE>setDate(java.util.Date)</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="setDate(java.util.Date)"><!-- --></A><H3>
setDate</H3>
<PRE>
public void <B>setDate</B>(<A HREF="../../../java/util/Date.html">Date</A> date)</PRE>
<DL>
<DD>Sets a new value for this field. <code>null</code> can be passed to set the field state to "not initialized" state. The input mode of this field defines what components of passed <code>Date</code> object is used.<p> In <code>TIME</code> input mode the date components must be set to the "zero epoch" value of January 1, 1970. If a date object that presents time beyond one day then this field is in "not initialized" state. In <code>TIME</code> input mode the date component of <code>Date</code> object is ignored and time component is used to precision of minutes.<p> In <code>DATE</code> input mode the time component of <code>Date</code> object is ignored.<p> In <code>DATE_TIME</code> input mode the date and time component of <code>Date</code> are used but only to precision of minutes.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>date</CODE> - new value for this field<DT><B>See Also: </B><DD><A HREF="../../../javax/microedition/lcdui/DateField.html#getDate()"><CODE>getDate()</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="getInputMode()"><!-- --></A><H3>
getInputMode</H3>
<PRE>
public int <B>getInputMode</B>()</PRE>
<DL>
<DD>Gets input mode for this date field. Valid input modes are <code>DATE</code>, <code>TIME</code> and <code>DATE_TIME</code>.<DD><DL>
<DT><B>Returns:</B><DD>input mode of this field<DT><B>See Also: </B><DD><A HREF="../../../javax/microedition/lcdui/DateField.html#setInputMode(int)"><CODE>setInputMode(int)</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="setInputMode(int)"><!-- --></A><H3>
setInputMode</H3>
<PRE>
public void <B>setInputMode</B>(int mode)</PRE>
<DL>
<DD>Set input mode for this date field. Valid input modes are <code>DATE</code>, <code>TIME</code> and <code>DATE_TIME</code>.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>mode</CODE> - the input mode, must be one of <code>DATE</code>, <code>TIME</code> or <code>DATE_TIME</code><DT><B>Throws:</B><DD><CODE><A HREF="../../../java/lang/IllegalArgumentException.html">IllegalArgumentException</A></CODE> - if an invalid value is specified<DT><B>See Also: </B><DD><A HREF="../../../javax/microedition/lcdui/DateField.html#getInputMode()"><CODE>getInputMode()</CODE></A></DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ========== START OF NAVBAR ========== -->
<A NAME="navbar_bottom"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/DateField.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
<strong>MID Profile</strong></EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../javax/microedition/lcdui/CustomItem.html"><B>PREV CLASS</B></A>
<A HREF="../../../javax/microedition/lcdui/Display.html"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../index.html" TARGET="_top"><B>FRAMES</B></A>
<A HREF="DateField.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: INNER | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<!-- =========== END OF NAVBAR =========== -->
<HR>
<font size="-1"><a href="mailto:midp-feedback@risc.sps.mot.com">Submit a comment or suggestion</a> Version 2.0 of MID Profile Specification<br>Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries. Copyright (c) 1993-2002 Sun Microsystems, Inc. 901 San Antonio Road,Palo Alto, California, 94303, U.S.A. All Rights Reserved.</font>
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -