📄 form.html
字号:
<DD>Adds an item consisting of one <code>String</code> to the <code>Form</code>. The effect of this method is identical to <p> <code> append(new StringItem(null, str)) </code> </p><DD><DL>
<DT><B>Parameters:</B><DD><CODE>str</CODE> - the <code>String</code> to be added<DT><B>Returns:</B><DD>the assigned index of the <code>Item</code><DT><B>Throws:</B><DD><CODE><A HREF="../../../java/lang/NullPointerException.html">NullPointerException</A></CODE> - if str is <code>null</code></DL>
</DD>
</DL>
<HR>
<A NAME="append(javax.microedition.lcdui.Image)"><!-- --></A><H3>
append</H3>
<PRE>
public int <B>append</B>(<A HREF="../../../javax/microedition/lcdui/Image.html">Image</A> img)</PRE>
<DL>
<DD>Adds an item consisting of one <code>Image</code> to the <code>Form</code>. The effect of this method is identical to <p> <code> append(new ImageItem(null, img, ImageItem.LAYOUT_DEFAULT, null)) </code> </p><DD><DL>
<DT><B>Parameters:</B><DD><CODE>img</CODE> - the image to be added<DT><B>Returns:</B><DD>the assigned index of the <code>Item</code><DT><B>Throws:</B><DD><CODE><A HREF="../../../java/lang/NullPointerException.html">NullPointerException</A></CODE> - if <code>img</code> is <code>null</code></DL>
</DD>
</DL>
<HR>
<A NAME="insert(int, javax.microedition.lcdui.Item)"><!-- --></A><H3>
insert</H3>
<PRE>
public void <B>insert</B>(int itemNum, <A HREF="../../../javax/microedition/lcdui/Item.html">Item</A> item)</PRE>
<DL>
<DD>Inserts an item into the <code>Form</code> just prior to the item specified. The size of the <code>Form</code> grows by one. The <code>itemNum</code> parameter must be within the range <code>[0..size()]</code>, inclusive. The index of the last item is <code>size()-1</code>, and so there is actually no item whose index is <code>size()</code>. If this value is used for <code>itemNum</code>, the new item is inserted immediately after the last item. In this case, the effect is identical to <A HREF="../../../javax/microedition/lcdui/Form.html#append(javax.microedition.lcdui.Item)"><CODE>append(Item)</CODE></A>. <p> The semantics are otherwise identical to <A HREF="../../../javax/microedition/lcdui/Form.html#append(javax.microedition.lcdui.Item)"><CODE>append(Item)</CODE></A>. </p><DD><DL>
<DT><B>Parameters:</B><DD><CODE>itemNum</CODE> - the index where insertion is to occur<DD><CODE>item</CODE> - the item to be inserted<DT><B>Throws:</B><DD><CODE><A HREF="../../../java/lang/IndexOutOfBoundsException.html">IndexOutOfBoundsException</A></CODE> - if <code>itemNum</code> is invalid<DD><CODE><A HREF="../../../java/lang/IllegalStateException.html">IllegalStateException</A></CODE> - if the item is already owned by a container<DD><CODE><A HREF="../../../java/lang/NullPointerException.html">NullPointerException</A></CODE> - if <code>item</code> is <code>null</code></DL>
</DD>
</DL>
<HR>
<A NAME="delete(int)"><!-- --></A><H3>
delete</H3>
<PRE>
public void <B>delete</B>(int itemNum)</PRE>
<DL>
<DD>Deletes the <code>Item</code> referenced by <code>itemNum</code>. The size of the <code>Form</code> shrinks by one. It is legal to delete all items from a <code>Form</code>. The <code>itemNum</code> parameter must be within the range <code>[0..size()-1]</code>, inclusive.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>itemNum</CODE> - the index of the item to be deleted<DT><B>Throws:</B><DD><CODE><A HREF="../../../java/lang/IndexOutOfBoundsException.html">IndexOutOfBoundsException</A></CODE> - if <code>itemNum</code> is invalid</DL>
</DD>
</DL>
<HR>
<A NAME="deleteAll()"><!-- --></A><H3>
deleteAll</H3>
<PRE>
public void <B>deleteAll</B>()</PRE>
<DL>
<DD>Deletes all the items from this <code>Form</code>, leaving it with zero items. This method does nothing if the <code>Form</code> is already empty.<DD><DL>
<DT><B>Since: </B><DD>MIDP 2.0</DD>
</DL>
</DD>
</DL>
<HR>
<A NAME="set(int, javax.microedition.lcdui.Item)"><!-- --></A><H3>
set</H3>
<PRE>
public void <B>set</B>(int itemNum, <A HREF="../../../javax/microedition/lcdui/Item.html">Item</A> item)</PRE>
<DL>
<DD>Sets the item referenced by <code>itemNum</code> to the specified item, replacing the previous item. The previous item is removed from this <code>Form</code>. The <code>itemNum</code> parameter must be within the range <code>[0..size()-1]</code>, inclusive. <p>The end result is equal to <code>insert(n, item); delete(n+1);</code><br> although the implementation may optimize the repainting and usage of the array that stores the items. <P><DD><DL>
<DT><B>Parameters:</B><DD><CODE>itemNum</CODE> - the index of the item to be replaced<DD><CODE>item</CODE> - the new item to be placed in the <code>Form</code><DT><B>Throws:</B><DD><CODE><A HREF="../../../java/lang/IndexOutOfBoundsException.html">IndexOutOfBoundsException</A></CODE> - if <code>itemNum</code> is invalid<DD><CODE><A HREF="../../../java/lang/IllegalStateException.html">IllegalStateException</A></CODE> - if the item is already owned by a container<DD><CODE><A HREF="../../../java/lang/NullPointerException.html">NullPointerException</A></CODE> - if <code>item</code> is <code>null</code></DL>
</DD>
</DL>
<HR>
<A NAME="get(int)"><!-- --></A><H3>
get</H3>
<PRE>
public <A HREF="../../../javax/microedition/lcdui/Item.html">Item</A> <B>get</B>(int itemNum)</PRE>
<DL>
<DD>Gets the item at given position. The contents of the <code>Form</code> are left unchanged. The <code>itemNum</code> parameter must be within the range <code>[0..size()-1]</code>, inclusive.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>itemNum</CODE> - the index of item<DT><B>Returns:</B><DD>the item at the given position<DT><B>Throws:</B><DD><CODE><A HREF="../../../java/lang/IndexOutOfBoundsException.html">IndexOutOfBoundsException</A></CODE> - if <code>itemNum</code> is invalid</DL>
</DD>
</DL>
<HR>
<A NAME="setItemStateListener(javax.microedition.lcdui.ItemStateListener)"><!-- --></A><H3>
setItemStateListener</H3>
<PRE>
public void <B>setItemStateListener</B>(<A HREF="../../../javax/microedition/lcdui/ItemStateListener.html">ItemStateListener</A> iListener)</PRE>
<DL>
<DD>Sets the <code>ItemStateListener</code> for the <code>Form</code>, replacing any previous <code>ItemStateListener</code>. If <code>iListener</code> is <code>null</code>, simply removes the previous <code>ItemStateListener</code>.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>iListener</CODE> - the new listener, or <code>null</code> to remove it</DL>
</DD>
</DL>
<HR>
<A NAME="size()"><!-- --></A><H3>
size</H3>
<PRE>
public int <B>size</B>()</PRE>
<DL>
<DD>Gets the number of items in the <code>Form</code>.<DD><DL>
<DT><B>Returns:</B><DD>the number of items</DL>
</DD>
</DL>
<HR>
<A NAME="getWidth()"><!-- --></A><H3>
getWidth</H3>
<PRE>
public int <B>getWidth</B>()</PRE>
<DL>
<DD>Returns the width in pixels of the displayable area available for items. The value may depend on how the device uses the screen and may be affected by the presence or absence of the ticker, title, or commands. The <code>Items</code> of the <code>Form</code> are laid out to fit within this width.<DD><DL>
<DT><B>Overrides:</B><DD><CODE><A HREF="../../../javax/microedition/lcdui/Displayable.html#getWidth()">getWidth</A></CODE> in class <CODE><A HREF="../../../javax/microedition/lcdui/Displayable.html">Displayable</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>the width of the <code>Form</code> in pixels<DT><B>Since: </B><DD>MIDP 2.0</DD>
</DL>
</DD>
</DL>
<HR>
<A NAME="getHeight()"><!-- --></A><H3>
getHeight</H3>
<PRE>
public int <B>getHeight</B>()</PRE>
<DL>
<DD>Returns the height in pixels of the displayable area available for items. This value is the height of the form that can be displayed without scrolling. The value may depend on how the device uses the screen and may be affected by the presence or absence of the ticker, title, or commands.<DD><DL>
<DT><B>Overrides:</B><DD><CODE><A HREF="../../../javax/microedition/lcdui/Displayable.html#getHeight()">getHeight</A></CODE> in class <CODE><A HREF="../../../javax/microedition/lcdui/Displayable.html">Displayable</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>the height of the displayable area of the <code>Form</code> in pixels<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> </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/Form.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/Font.html"><B>PREV CLASS</B></A>
<A HREF="../../../javax/microedition/lcdui/Gauge.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="Form.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 + -