list.html

来自「API資料大全」· HTML 代码 · 共 1,249 行 · 第 1/5 页

HTML
1,249
字号
<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="addNotify()"><!-- --></A><H3>addNotify</H3><PRE>public void <B>addNotify</B>()</PRE><DL><DD>Creates the peer for the list.  The peer allows us to modify the list's appearance without changing its functionality.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../java/awt/Component.html#addNotify()">addNotify</A></CODE> in class <CODE><A HREF="../../java/awt/Component.html">Component</A></CODE></DL></DD><DD>Following copied from class: <CODE>java.awt.Component</CODE></DD><DD><DL><DT><B>See Also: </B><DD><A HREF="../../java/awt/Component.html#isDisplayable()"><CODE>Component.isDisplayable()</CODE></A>, <A HREF="../../java/awt/Component.html#removeNotify()"><CODE>Component.removeNotify()</CODE></A></DL></DD></DL><HR><A NAME="removeNotify()"><!-- --></A><H3>removeNotify</H3><PRE>public void <B>removeNotify</B>()</PRE><DL><DD>Removes the peer for this list.  The peer allows us to modify the list's appearance without changing its functionality.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../java/awt/Component.html#removeNotify()">removeNotify</A></CODE> in class <CODE><A HREF="../../java/awt/Component.html">Component</A></CODE></DL></DD><DD>Following copied from class: <CODE>java.awt.Component</CODE></DD><DD><DL><DT><B>See Also: </B><DD><A HREF="../../java/awt/Component.html#isDisplayable()"><CODE>Component.isDisplayable()</CODE></A>, <A HREF="../../java/awt/Component.html#addNotify()"><CODE>Component.addNotify()</CODE></A></DL></DD></DL><HR><A NAME="getItemCount()"><!-- --></A><H3>getItemCount</H3><PRE>public int <B>getItemCount</B>()</PRE><DL><DD>Gets the number of items in the list.<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the number of items in the list.<DT><B>Since: </B><DD>JDK1.1</DD><DT><B>See Also: </B><DD><A HREF="../../java/awt/List.html#getItem(int)"><CODE>getItem(int)</CODE></A></DL></DD></DL><HR><A NAME="countItems()"><!-- --></A><H3>countItems</H3><PRE>public int <B>countItems</B>()</PRE><DL><DD><B>Deprecated.</B>&nbsp;<I>As of JDK version 1.1, replaced by <code>getItemCount()</code>.</I><P><DD><DL></DL></DD></DL><HR><A NAME="getItem(int)"><!-- --></A><H3>getItem</H3><PRE>public <A HREF="../../java/lang/String.html">String</A> <B>getItem</B>(int&nbsp;index)</PRE><DL><DD>Gets the item associated with the specified index.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>index</CODE> - the position of the item.<DT><B>Returns:</B><DD>an item that is associated with                    the specified index.<DT><B>See Also: </B><DD><A HREF="../../java/awt/List.html#getItemCount()"><CODE>getItemCount()</CODE></A></DL></DD></DL><HR><A NAME="getItems()"><!-- --></A><H3>getItems</H3><PRE>public <A HREF="../../java/lang/String.html">String</A>[] <B>getItems</B>()</PRE><DL><DD>Gets the items in the list.<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>a string array containing items of the list.<DT><B>Since: </B><DD>JDK1.1</DD><DT><B>See Also: </B><DD><A HREF="../../java/awt/List.html#select(int)"><CODE>select(int)</CODE></A>, <A HREF="../../java/awt/List.html#deselect(int)"><CODE>deselect(int)</CODE></A>, <A HREF="../../java/awt/List.html#isIndexSelected(int)"><CODE>isIndexSelected(int)</CODE></A></DL></DD></DL><HR><A NAME="add(java.lang.String)"><!-- --></A><H3>add</H3><PRE>public void <B>add</B>(<A HREF="../../java/lang/String.html">String</A>&nbsp;item)</PRE><DL><DD>Adds the specified item to the end of scrolling list.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>item</CODE> - the item to be added.<DT><B>Since: </B><DD>JDK1.1</DD></DL></DD></DL><HR><A NAME="addItem(java.lang.String)"><!-- --></A><H3>addItem</H3><PRE>public void <B>addItem</B>(<A HREF="../../java/lang/String.html">String</A>&nbsp;item)</PRE><DL><DD><B>Deprecated.</B>&nbsp;<I>replaced by <code>add(String)</code>.</I><P><DD><DL></DL></DD></DL><HR><A NAME="add(java.lang.String, int)"><!-- --></A><H3>add</H3><PRE>public void <B>add</B>(<A HREF="../../java/lang/String.html">String</A>&nbsp;item,                int&nbsp;index)</PRE><DL><DD>Adds the specified item to the the scrolling list at the position indicated by the index.  The index is  zero-based.  If the value of the index is less than zero,  or if the value of the index is greater than or equal to  the number of items in the list, then the item is added  to the end of the list.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>item</CODE> - the item to be added.              If this parameter is null then the item is              treated as an empty string, <code>""</code>.<DD><CODE>index</CODE> - the position at which to add the item.<DT><B>Since: </B><DD>JDK1.1</DD></DL></DD></DL><HR><A NAME="addItem(java.lang.String, int)"><!-- --></A><H3>addItem</H3><PRE>public void <B>addItem</B>(<A HREF="../../java/lang/String.html">String</A>&nbsp;item,                    int&nbsp;index)</PRE><DL><DD><B>Deprecated.</B>&nbsp;<I>replaced by <code>add(String, int)</code>.</I><P><DD><DL></DL></DD></DL><HR><A NAME="replaceItem(java.lang.String, int)"><!-- --></A><H3>replaceItem</H3><PRE>public void <B>replaceItem</B>(<A HREF="../../java/lang/String.html">String</A>&nbsp;newValue,                        int&nbsp;index)</PRE><DL><DD>Replaces the item at the specified index in the scrolling list with the new string.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>newValue</CODE> - a new string to replace an existing item.<DD><CODE>index</CODE> - the position of the item to replace.</DL></DD></DL><HR><A NAME="removeAll()"><!-- --></A><H3>removeAll</H3><PRE>public void <B>removeAll</B>()</PRE><DL><DD>Removes all items from this list.<DD><DL></DL></DD><DD><DL><DT><B>Since: </B><DD>JDK1.1</DD><DT><B>See Also: </B><DD><A HREF="../../java/awt/List.html#remove(java.lang.String)"><CODE>remove(java.lang.String)</CODE></A>, <A HREF="../../java/awt/List.html#delItems(int, int)"><CODE>delItems(int, int)</CODE></A></DL></DD></DL><HR><A NAME="clear()"><!-- --></A><H3>clear</H3><PRE>public void <B>clear</B>()</PRE><DL><DD><B>Deprecated.</B>&nbsp;<I>As of JDK version 1.1, replaced by <code>removeAll()</code>.</I><P><DD><DL></DL></DD></DL><HR><A NAME="remove(java.lang.String)"><!-- --></A><H3>remove</H3><PRE>public void <B>remove</B>(<A HREF="../../java/lang/String.html">String</A>&nbsp;item)</PRE><DL><DD>Removes the first occurrence of an item from the list.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>item</CODE> - the item to remove from the list.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/IllegalArgumentException.html">IllegalArgumentException</A></CODE> - if the item doesn't exist in the list.<DT><B>Since: </B><DD>JDK1.1</DD></DL></DD></DL><HR><A NAME="remove(int)"><!-- --></A><H3>remove</H3><PRE>public void <B>remove</B>(int&nbsp;position)</PRE><DL><DD>Remove the item at the specified position from this scrolling list.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>position</CODE> - the index of the item to delete.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/ArrayIndexOutOfBoundsException.html">ArrayIndexOutOfBoundsException</A></CODE> - if the <code>position</code> is less than 0 or               greater than <code>getItemCount()-1</code><DT><B>Since: </B><DD>JDK1.1</DD><DT><B>See Also: </B><DD><A HREF="../../java/awt/List.html#add(java.lang.String, int)"><CODE>add(String, int)</CODE></A></DL></DD></DL><HR><A NAME="delItem(int)"><!-- --></A><H3>delItem</H3><PRE>

⌨️ 快捷键说明

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