📄 textbox.html
字号:
the data array to be used for insertion. Behavior is otherwise identical to <A HREF="../../../javax/microedition/lcdui/TextBox.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) <= 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 data 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 offset, int length)</PRE>
<DL>
<DD>Deletes characters from the <code>TextBox</code>. <p>The <code>offset</code> and <code>length</code> parameters must specify a valid range of characters within the contents of the <code>TextBox</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) <= 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>TextBox</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>TextBox</code>.<DD><DL>
<DT><B>Returns:</B><DD>the maximum size in characters<DT><B>See Also: </B><DD><A HREF="../../../javax/microedition/lcdui/TextBox.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 maxSize)</PRE>
<DL>
<DD>Sets the maximum size (number of characters) that can be contained in this <code>TextBox</code>. If the current contents of the <code>TextBox</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/TextBox.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>TextBox</code>.<DD><DL>
<DT><B>Returns:</B><DD>the number of characters</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 constraints)</PRE>
<DL>
<DD>Sets the input constraints of the <code>TextBox</code>. If the current contents of the <code>TextBox</code> do not match the new constraints, the contents are set to empty.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>constraints</CODE> - see <a href="TextField.html#constraints">input constraints</a><DT><B>Throws:</B><DD><CODE><A HREF="../../../java/lang/IllegalArgumentException.html">IllegalArgumentException</A></CODE> - if the value of the constraints parameter is invalid<DT><B>See Also: </B><DD><A HREF="../../../javax/microedition/lcdui/TextBox.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>TextBox</code>.<DD><DL>
<DT><B>Returns:</B><DD>the current constraints value (see <a href="TextField.html#constraints">input constraints</a>)<DT><B>See Also: </B><DD><A HREF="../../../javax/microedition/lcdui/TextBox.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> 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>TextBox</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="TextField#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>
<HR>
<A NAME="setTitle(java.lang.String)"><!-- --></A><H3>
setTitle</H3>
<PRE>
public void <B>setTitle</B>(<A HREF="../../../java/lang/String.html">String</A> s)</PRE>
<DL>
<DD>Sets the title of the <code>Displayable</code>. If <code>null</code> is given, removes the title. <P>If the <code>Displayable</code> is actually visible on the display, the implementation should update the display as soon as it is feasible to do so.</P> <P>The existence of a title may affect the size of the area available for <code>Displayable</code> content. If the application adds, removes, or sets the title text at runtime, this can dynamically change the size of the content area. This is most important to be aware of when using the <code>Canvas</code> class.</p><DD><DL>
<DT><B>Overrides:</B><DD><CODE><A HREF="../../../javax/microedition/lcdui/Displayable.html#setTitle(java.lang.String)">setTitle</A></CODE> in class <CODE><A HREF="../../../javax/microedition/lcdui/Displayable.html">Displayable</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>s</CODE> - the new title, or <code>null</code> for no title<DT><B>Since: </B><DD>MIDP 2.0</DD>
<DT><B>See Also: </B><DD><A HREF="../../../javax/microedition/lcdui/Displayable.html#getTitle()"><CODE>Displayable.getTitle()</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="setTicker(javax.microedition.lcdui.Ticker)"><!-- --></A><H3>
setTicker</H3>
<PRE>
public void <B>setTicker</B>(<A HREF="../../../javax/microedition/lcdui/Ticker.html">Ticker</A> ticker)</PRE>
<DL>
<DD>Sets a ticker for use with this <code>Displayable</code>, replacing any previous ticker. If <code>null</code>, removes the ticker object from this <code>Displayable</code>. The same ticker may be shared by several <code>Displayable</code> objects within an application. This is done by calling <code>setTicker()</code> with the same <code>Ticker</code> object on several different <code>Displayable</code> objects. If the <code>Displayable</code> is actually visible on the display, the implementation should update the display as soon as it is feasible to do so. <p>The existence of a ticker may affect the size of the area available for <code>Displayable's</code> contents. If the application adds, removes, or sets the ticker text at runtime, this can dynamically change the size of the content area. This is most important to be aware of when using the <code>Canvas</code> class.<DD><DL>
<DT><B>Overrides:</B><DD><CODE><A HREF="../../../javax/microedition/lcdui/Displayable.html#setTicker(javax.microedition.lcdui.Ticker)">setTicker</A></CODE> in class <CODE><A HREF="../../../javax/microedition/lcdui/Displayable.html">Displayable</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>ticker</CODE> - the ticker object used on this screen<DT><B>Since: </B><DD>MIDP 2.0</DD>
<DT><B>See Also: </B><DD><A HREF="../../../javax/microedition/lcdui/Displayable.html#getTicker()"><CODE>Displayable.getTicker()</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/TextBox.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/StringItem.html"><B>PREV CLASS</B></A>
<A HREF="../../../javax/microedition/lcdui/TextField.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="TextBox.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: INNER | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: FIELD | <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 + -