📄 textfield.html
字号:
UCB_DEVANAGARI<br> UCB_BENGALI<br> UCB_THAI<br> UCB_HIRAGANA<br> UCB_KATAKANA<br> UCB_HANGUL_SYLLABLES<br> </code></blockquote> <P>"Input subsets" as defined by the J2SE class <code>java.awt.im.InputSubset</code> may be named by adding the prefix "<code>IS_</code>" to the string names of fields representing input subsets as defined in that class. Any defined input subset may be used. For convenience, the names of the currently defined input subsets are listed below. <blockquote><code> IS_FULLWIDTH_DIGITS<br> IS_FULLWIDTH_LATIN<br> IS_HALFWIDTH_KATAKANA<br> IS_HANJA<br> IS_KANJI<br> IS_LATIN<br> IS_LATIN_DIGITS<br> IS_SIMPLIFIED_HANZI<br> IS_TRADITIONAL_HANZI<br> </code></blockquote> <P>MIDP has also defined the following character subsets: <blockquote> <code>MIDP_UPPERCASE_LATIN</code> - the subset of <code>IS_LATIN</code> that corresponds to uppercase Latin letters </blockquote> <blockquote> <code>MIDP_LOWERCASE_LATIN</code> - the subset of <code>IS_LATIN</code> that corresponds to lowercase Latin letters </blockquote> <p> Finally, implementation-specific character subsets may be named with strings that have a prefix of "<code>X_</code>". In order to avoid namespace conflicts, it is recommended that implementation-specific names include the name of the defining company or organization after the initial "<code>X_</code>" prefix. <p> For example, a Japanese language application might have a particular <code>TextField</code> that the application intends to be used primarily for input of words that are "loaned" from languages other than Japanese. The application might request an input mode facilitating Hiragana input by issuing the following method call:</p> <TABLE BORDER="2"> <TR> <TD ROWSPAN="1" COLSPAN="1"> <pre><code> textfield.setInitialInputMode("UCB_HIRAGANA"); </code></pre> </TD> </TR> </TABLE> <h3>Implementation Note</h3> <p>Implementations need not compile in all the strings listed above. Instead, they need only to compile in the strings that name Unicode character subsets that they support. If the subset name passed by the application does not match a known subset name, the request should simply be ignored without error, and a default input mode should be used. This lets implementations support this feature reasonably inexpensively. However, it has the consequence that the application cannot tell whether its request has been accepted, nor whether the Unicode character subset it has requested is actually a valid subset.
<P>
<DL>
<DT><B>Since: </B><DD>MIDP 1.0</DD>
</DL>
<HR>
<P>
<!-- ======== INNER CLASS SUMMARY ======== -->
<!-- =========== FIELD SUMMARY =========== -->
<A NAME="field_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Field Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/lcdui/TextField.html#ANY">ANY</A></B></CODE>
<BR>
The user is allowed to enter any text.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/lcdui/TextField.html#CONSTRAINT_MASK">CONSTRAINT_MASK</A></B></CODE>
<BR>
The mask value for determining the constraint mode.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/lcdui/TextField.html#DECIMAL">DECIMAL</A></B></CODE>
<BR>
The user is allowed to enter numeric values with optional decimal fractions, for example "-123", "0.123", or ".5".</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/lcdui/TextField.html#EMAILADDR">EMAILADDR</A></B></CODE>
<BR>
The user is allowed to enter an e-mail address.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/lcdui/TextField.html#INITIAL_CAPS_SENTENCE">INITIAL_CAPS_SENTENCE</A></B></CODE>
<BR>
This flag is a hint to the implementation that during text editing, the initial letter of each sentence should be capitalized.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/lcdui/TextField.html#INITIAL_CAPS_WORD">INITIAL_CAPS_WORD</A></B></CODE>
<BR>
This flag is a hint to the implementation that during text editing, the initial letter of each word should be capitalized.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/lcdui/TextField.html#NON_PREDICTIVE">NON_PREDICTIVE</A></B></CODE>
<BR>
Indicates that the text entered does not consist of words that are likely to be found in dictionaries typically used by predictive input schemes.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/lcdui/TextField.html#NUMERIC">NUMERIC</A></B></CODE>
<BR>
The user is allowed to enter only an integer value.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/lcdui/TextField.html#PASSWORD">PASSWORD</A></B></CODE>
<BR>
Indicates that the text entered is confidential data that should be obscured whenever possible.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/lcdui/TextField.html#PHONENUMBER">PHONENUMBER</A></B></CODE>
<BR>
The user is allowed to enter a phone number.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/lcdui/TextField.html#SENSITIVE">SENSITIVE</A></B></CODE>
<BR>
Indicates that the text entered is sensitive data that the implementation must never store into a dictionary or table for use in predictive, auto-completing, or other accelerated input schemes.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/lcdui/TextField.html#UNEDITABLE">UNEDITABLE</A></B></CODE>
<BR>
Indicates that editing is currently disallowed.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/lcdui/TextField.html#URL">URL</A></B></CODE>
<BR>
The user is allowed to enter a URL.</TD>
</TR>
</TABLE>
<A NAME="fields_inherited_from_class_javax.microedition.lcdui.Item"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TD><B>Fields inherited from class javax.microedition.lcdui.<A HREF="../../../javax/microedition/lcdui/Item.html">Item</A></B></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../../javax/microedition/lcdui/Item.html#BUTTON">BUTTON</A>, <A HREF="../../../javax/microedition/lcdui/Item.html#HYPERLINK">HYPERLINK</A>, <A HREF="../../../javax/microedition/lcdui/Item.html#LAYOUT_2">LAYOUT_2</A>, <A HREF="../../../javax/microedition/lcdui/Item.html#LAYOUT_BOTTOM">LAYOUT_BOTTOM</A>, <A HREF="../../../javax/microedition/lcdui/Item.html#LAYOUT_CENTER">LAYOUT_CENTER</A>, <A HREF="../../../javax/microedition/lcdui/Item.html#LAYOUT_DEFAULT">LAYOUT_DEFAULT</A>, <A HREF="../../../javax/microedition/lcdui/Item.html#LAYOUT_EXPAND">LAYOUT_EXPAND</A>, <A HREF="../../../javax/microedition/lcdui/Item.html#LAYOUT_LEFT">LAYOUT_LEFT</A>, <A HREF="../../../javax/microedition/lcdui/Item.html#LAYOUT_NEWLINE_AFTER">LAYOUT_NEWLINE_AFTER</A>, <A HREF="../../../javax/microedition/lcdui/Item.html#LAYOUT_NEWLINE_BEFORE">LAYOUT_NEWLINE_BEFORE</A>, <A HREF="../../../javax/microedition/lcdui/Item.html#LAYOUT_RIGHT">LAYOUT_RIGHT</A>, <A HREF="../../../javax/microedition/lcdui/Item.html#LAYOUT_SHRINK">LAYOUT_SHRINK</A>, <A HREF="../../../javax/microedition/lcdui/Item.html#LAYOUT_TOP">LAYOUT_TOP</A>, <A HREF="../../../javax/microedition/lcdui/Item.html#LAYOUT_VCENTER">LAYOUT_VCENTER</A>, <A HREF="../../../javax/microedition/lcdui/Item.html#LAYOUT_VEXPAND">LAYOUT_VEXPAND</A>, <A HREF="../../../javax/microedition/lcdui/Item.html#LAYOUT_VSHRINK">LAYOUT_VSHRINK</A>, <A HREF="../../../javax/microedition/lcdui/Item.html#PLAIN">PLAIN</A></CODE></TD>
</TR>
</TABLE>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<A NAME="constructor_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../javax/microedition/lcdui/TextField.html#TextField(java.lang.String, java.lang.String, int, int)">TextField</A></B>(<A HREF="../../../java/lang/String.html">String</A> label, <A HREF="../../../java/lang/String.html">String</A> text, int maxSize, int constraints)</CODE>
<BR>
Creates a new <code>TextField</code> object with the given label, initial contents, maximum size in characters, and constraints.</TD>
</TR>
</TABLE>
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Method Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/lcdui/TextField.html#delete(int, int)">delete</A></B>(int offset, int length)</CODE>
<BR>
Deletes characters from the <code>TextField</code>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/lcdui/TextField.html#getCaretPosition()">getCaretPosition</A></B>()</CODE>
<BR>
Gets the current input position.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/lcdui/TextField.html#getChars(char[])">getChars</A></B>(char[] data)</CODE>
<BR>
Copies the contents of the <code>TextField</code> into a character array starting at index zero.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -