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

📄 textfield.html

📁 是MIDP 的API 查詢文件, 大家可以看一下裡面的index.html, 再用Package 或 Class 名字來查.
💻 HTML
📖 第 1 页 / 共 5 页
字号:
<HR>

<A NAME="setChars(char[], int, int)"><!-- --></A><H3>
setChars</H3>
<PRE>
public void <B>setChars</B>(char[]&nbsp;data,                     int&nbsp;offset,                     int&nbsp;length)</PRE>
<DL>
<DD>Sets the contents of the <code>TextField</code> from a character array, replacing the previous contents. Characters are copied from the region of the <code>data</code> array starting at array index <code>offset</code> and running for <code>length</code> characters. If the data array is <code>null</code>, the <code>TextField</code> is set to be empty and the other parameters are ignored. <p>The <code>offset</code> and <code>length</code> parameters must specify a valid range of characters within the character array <code>data</code>. The <code>offset</code> parameter must be within the range <code>[0..(data.length)]</code>, inclusive. The <code>length</code> parameter must be a non-negative integer such that <code>(offset + length) &lt;= data.length</code>.</p><DD><DL>
<DT><B>Parameters:</B><DD><CODE>data</CODE> - the source of the character data<DD><CODE>offset</CODE> - the beginning of the region of characters to copy<DD><CODE>length</CODE> - the number of characters to copy<DT><B>Throws:</B><DD><CODE><A HREF="../../../java/lang/ArrayIndexOutOfBoundsException.html">ArrayIndexOutOfBoundsException</A></CODE> - if <code>offset</code> and <code>length</code> do not specify a valid range within the data array<DD><CODE><A HREF="../../../java/lang/IllegalArgumentException.html">IllegalArgumentException</A></CODE> - if <code>data</code> is illegal for the current <a href="TextField.html#constraints">input constraints</a><DD><CODE><A HREF="../../../java/lang/IllegalArgumentException.html">IllegalArgumentException</A></CODE> - if the text would exceed the current maximum capacity<DT><B>See Also: </B><DD><A HREF="../../../javax/microedition/lcdui/TextField.html#getChars(char[])"><CODE>getChars(char[])</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="insert(java.lang.String, int)"><!-- --></A><H3>
insert</H3>
<PRE>
public void <B>insert</B>(<A HREF="../../../java/lang/String.html">String</A>&nbsp;src,                   int&nbsp;position)</PRE>
<DL>
<DD>Inserts a string into the contents of the <code>TextField</code>.  The string is inserted just prior to the character indicated by the <code>position</code> parameter, where zero specifies the first character of the contents of the <code>TextField</code>.  If <code>position</code> is less than or equal to zero, the insertion occurs at the beginning of the contents, thus effecting a prepend operation.  If <code>position</code> is greater than or equal to the current size of the contents, the insertion occurs immediately after the end of the contents, thus effecting an append operation.  For example, <code>text.insert(s, text.size())</code> always appends the string <code>s</code> to the current contents. <p>The current size of the contents is increased by the number of inserted characters. The resulting string must fit within the current maximum capacity. </p> <p>If the application needs to simulate typing of characters it can determining the location of the current insertion point (&quot;caret&quot;) using the with <A HREF="../../../javax/microedition/lcdui/TextField.html#getCaretPosition()"><CODE>getCaretPosition()</CODE></A> method. For example, <code>text.insert(s, text.getCaretPosition())</code> inserts the string <code>s</code> at the current caret position.</p><DD><DL>
<DT><B>Parameters:</B><DD><CODE>src</CODE> - the <code>String</code> to be inserted<DD><CODE>position</CODE> - the position at which insertion is to occur<DT><B>Throws:</B><DD><CODE><A HREF="../../../java/lang/IllegalArgumentException.html">IllegalArgumentException</A></CODE> - if the resulting contents would be illegal for the current <a href="TextField.html#constraints">input constraints</a><DD><CODE><A HREF="../../../java/lang/IllegalArgumentException.html">IllegalArgumentException</A></CODE> - if the insertion would exceed the current maximum capacity<DD><CODE><A HREF="../../../java/lang/NullPointerException.html">NullPointerException</A></CODE> - if <code>src</code> is <code>null</code></DL>
</DD>
</DL>
<HR>

<A NAME="insert(char[], int, int, int)"><!-- --></A><H3>
insert</H3>
<PRE>
public void <B>insert</B>(char[]&nbsp;data,                   int&nbsp;offset,                   int&nbsp;length,                   int&nbsp;position)</PRE>
<DL>
<DD>Inserts a subrange of an array of characters into the contents of the <code>TextField</code>.  The <code>offset</code> and <code>length</code> parameters indicate the subrange of the data array to be used for insertion. Behavior is otherwise identical to <A HREF="../../../javax/microedition/lcdui/TextField.html#insert(java.lang.String, int)"><CODE>insert(String, int)</CODE></A>. <p>The <code>offset</code> and <code>length</code> parameters must specify a valid range of characters within the character array <code>data</code>. The <code>offset</code> parameter must be within the range <code>[0..(data.length)]</code>, inclusive. The <code>length</code> parameter must be a non-negative integer such that <code>(offset + length) &lt;= data.length</code>.</p><DD><DL>
<DT><B>Parameters:</B><DD><CODE>data</CODE> - the source of the character data<DD><CODE>offset</CODE> - the beginning of the region of characters to copy<DD><CODE>length</CODE> - the number of characters to copy<DD><CODE>position</CODE> - the position at which insertion is to occur<DT><B>Throws:</B><DD><CODE><A HREF="../../../java/lang/ArrayIndexOutOfBoundsException.html">ArrayIndexOutOfBoundsException</A></CODE> - if <code>offset</code> and <code>length</code> do not specify a valid range within the <code>data</code> array<DD><CODE><A HREF="../../../java/lang/IllegalArgumentException.html">IllegalArgumentException</A></CODE> - if the resulting contents would be illegal for the current <a href="TextField.html#constraints">input constraints</a><DD><CODE><A HREF="../../../java/lang/IllegalArgumentException.html">IllegalArgumentException</A></CODE> - if the insertion would exceed the current maximum capacity<DD><CODE><A HREF="../../../java/lang/NullPointerException.html">NullPointerException</A></CODE> - if <code>data</code> is <code>null</code></DL>
</DD>
</DL>
<HR>

<A NAME="delete(int, int)"><!-- --></A><H3>
delete</H3>
<PRE>
public void <B>delete</B>(int&nbsp;offset,                   int&nbsp;length)</PRE>
<DL>
<DD>Deletes characters from the <code>TextField</code>. <p>The <code>offset</code> and <code>length</code> parameters must specify a valid range of characters within the contents of the <code>TextField</code>. The <code>offset</code> parameter must be within the range <code>[0..(size())]</code>, inclusive. The <code>length</code> parameter must be a non-negative integer such that <code>(offset + length) &lt;= size()</code>.</p><DD><DL>
<DT><B>Parameters:</B><DD><CODE>offset</CODE> - the beginning of the region to be deleted<DD><CODE>length</CODE> - the number of characters to be deleted<DT><B>Throws:</B><DD><CODE><A HREF="../../../java/lang/IllegalArgumentException.html">IllegalArgumentException</A></CODE> - if the resulting contents would be illegal for the current <a href="TextField.html#constraints">input constraints</a><DD><CODE><A HREF="../../../java/lang/StringIndexOutOfBoundsException.html">StringIndexOutOfBoundsException</A></CODE> - if <code>offset</code> and <code>length</code> do not specify a valid range within the contents of the <code>TextField</code></DL>
</DD>
</DL>
<HR>

<A NAME="getMaxSize()"><!-- --></A><H3>
getMaxSize</H3>
<PRE>
public int <B>getMaxSize</B>()</PRE>
<DL>
<DD>Returns the maximum size (number of characters) that can be stored in this <code>TextField</code>.<DD><DL>
<DT><B>Returns:</B><DD>the maximum size in characters<DT><B>See Also: </B><DD><A HREF="../../../javax/microedition/lcdui/TextField.html#setMaxSize(int)"><CODE>setMaxSize(int)</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="setMaxSize(int)"><!-- --></A><H3>
setMaxSize</H3>
<PRE>
public int <B>setMaxSize</B>(int&nbsp;maxSize)</PRE>
<DL>
<DD>Sets the maximum size (number of characters) that can be contained in this <code>TextField</code>. If the current contents of the <code>TextField</code> are larger than <code>maxSize</code>, the contents are truncated to fit.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>maxSize</CODE> - the new maximum size<DT><B>Returns:</B><DD>assigned maximum capacity - may be smaller than requested.<DT><B>Throws:</B><DD><CODE><A HREF="../../../java/lang/IllegalArgumentException.html">IllegalArgumentException</A></CODE> - if <code>maxSize</code> is zero or less.<DD><CODE><A HREF="../../../java/lang/IllegalArgumentException.html">IllegalArgumentException</A></CODE> - if the contents after truncation would be illegal for the current <a href="TextField.html#constraints">input constraints</a><DT><B>See Also: </B><DD><A HREF="../../../javax/microedition/lcdui/TextField.html#getMaxSize()"><CODE>getMaxSize()</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="size()"><!-- --></A><H3>
size</H3>
<PRE>
public int <B>size</B>()</PRE>
<DL>
<DD>Gets the number of characters that are currently stored in this <code>TextField</code>.<DD><DL>
<DT><B>Returns:</B><DD>number of characters in the <code>TextField</code></DL>
</DD>
</DL>
<HR>

<A NAME="getCaretPosition()"><!-- --></A><H3>
getCaretPosition</H3>
<PRE>
public int <B>getCaretPosition</B>()</PRE>
<DL>
<DD>Gets the current input position.  For some UIs this may block and ask the user for the intended caret position, and on other UIs this may simply return the current caret position.<DD><DL>
<DT><B>Returns:</B><DD>the current caret position, <code>0</code> if at the beginning</DL>
</DD>
</DL>
<HR>

<A NAME="setConstraints(int)"><!-- --></A><H3>
setConstraints</H3>
<PRE>
public void <B>setConstraints</B>(int&nbsp;constraints)</PRE>
<DL>
<DD>Sets the input constraints of the <code>TextField</code>. If the the current contents of the <code>TextField</code> do not match the new <code>constraints</code>, the contents are set to empty.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>constraints</CODE> - see <a href="#constraints">input constraints</a><DT><B>Throws:</B><DD><CODE><A HREF="../../../java/lang/IllegalArgumentException.html">IllegalArgumentException</A></CODE> - if constraints is not any of the ones specified in <a href="TextField.html#constraints">input constraints</a><DT><B>See Also: </B><DD><A HREF="../../../javax/microedition/lcdui/TextField.html#getConstraints()"><CODE>getConstraints()</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="getConstraints()"><!-- --></A><H3>
getConstraints</H3>
<PRE>
public int <B>getConstraints</B>()</PRE>
<DL>
<DD>Gets the current input constraints of the <code>TextField</code>.<DD><DL>
<DT><B>Returns:</B><DD>the current constraints value (see <a href="#constraints">input constraints</a>)<DT><B>See Also: </B><DD><A HREF="../../../javax/microedition/lcdui/TextField.html#setConstraints(int)"><CODE>setConstraints(int)</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="setInitialInputMode(java.lang.String)"><!-- --></A><H3>
setInitialInputMode</H3>
<PRE>
public void <B>setInitialInputMode</B>(<A HREF="../../../java/lang/String.html">String</A>&nbsp;characterSubset)</PRE>
<DL>
<DD>Sets a hint to the implementation as to the input mode that should be  used when the user initiates editing of this <code>TextField</code>.  The <code>characterSubset</code> parameter names a subset of Unicode  characters that is used by the implementation to choose an initial  input mode.  If <code>null</code> is passed, the implementation should  choose a default input mode. <p>See <a href="#modes">Input Modes</a> for a full explanation of input  modes. </p><DD><DL>
<DT><B>Parameters:</B><DD><CODE>characterSubset</CODE> - a string naming a Unicode character subset, or <code>null</code><DT><B>Since: </B><DD>MIDP 2.0</DD>
</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>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/TextField.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</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">
&nbsp;<A HREF="../../../javax/microedition/lcdui/TextBox.html"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../javax/microedition/lcdui/Ticker.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>  &nbsp

⌨️ 快捷键说明

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