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

📄 defaultlistmodel.html

📁 API資料大全
💻 HTML
📖 第 1 页 / 共 3 页
字号:
<DT><B>Parameters:</B><DD><CODE>elem</CODE> - the desired component.<DD><CODE>index</CODE> - the index to start searching from.<DT><B>Returns:</B><DD>the index of the last occurrence of the specified object in this          list at position less than <code>index</code> in the           list; <code>-1</code> if the object is not found.<DT><B>See Also: </B><DD><A HREF="../../java/util/Vector.html#lastIndexOf(java.lang.Object, int)"><CODE>Vector.lastIndexOf(Object,int)</CODE></A></DL></DD></DL><HR><A NAME="elementAt(int)"><!-- --></A><H3>elementAt</H3><PRE>public <A HREF="../../java/lang/Object.html">Object</A> <B>elementAt</B>(int&nbsp;index)</PRE><DL><DD>Returns the component at the specified index. Throws an <tt>ArrayIndexOutOfBoundsException</tt> if the index is negative or not less than the size of the list. <blockquote> <b>Note:</b> Although this method is not deprecated, the preferred    method to use is <tt>get(int)</tt>, which implements the     <tt>List</tt> interface defined in the 1.2 Collections framework. </blockquote><DD><DL><DT><B>Parameters:</B><DD><CODE>index</CODE> - an index into this list.<DT><B>Returns:</B><DD>the component at the specified index.<DT><B>See Also: </B><DD><A HREF="../../javax/swing/DefaultListModel.html#get(int)"><CODE>get(int)</CODE></A>, <A HREF="../../java/util/Vector.html#elementAt(int)"><CODE>Vector.elementAt(int)</CODE></A></DL></DD></DL><HR><A NAME="firstElement()"><!-- --></A><H3>firstElement</H3><PRE>public <A HREF="../../java/lang/Object.html">Object</A> <B>firstElement</B>()</PRE><DL><DD>Returns the first component of this list. Throws a <tt>NoSuchElementException</tt> if this vector has no components     *<DD><DL><DT><B>Returns:</B><DD>the first component of this list<DT><B>See Also: </B><DD><A HREF="../../java/util/Vector.html#firstElement()"><CODE>Vector.firstElement()</CODE></A></DL></DD></DL><HR><A NAME="lastElement()"><!-- --></A><H3>lastElement</H3><PRE>public <A HREF="../../java/lang/Object.html">Object</A> <B>lastElement</B>()</PRE><DL><DD>Returns the last component of the list. Throws a <tt>NoSuchElementException</tt> if this vector has no components     *<DD><DL><DT><B>Returns:</B><DD>the last component of the list<DT><B>See Also: </B><DD><A HREF="../../java/util/Vector.html#lastElement()"><CODE>Vector.lastElement()</CODE></A></DL></DD></DL><HR><A NAME="setElementAt(java.lang.Object, int)"><!-- --></A><H3>setElementAt</H3><PRE>public void <B>setElementAt</B>(<A HREF="../../java/lang/Object.html">Object</A>&nbsp;obj,                         int&nbsp;index)</PRE><DL><DD>Sets the component at the specified <code>index</code> of this  list to be the specified object. The previous component at that  position is discarded. <p> Throws an <tt>ArrayIndexOutOfBoundsException</tt> if the index  is invalid. <blockquote> <b>Note:</b> Although this method is not deprecated, the preferred    method to use is <tt>set(int,Object)</tt>, which implements the     <tt>List</tt> interface defined in the 1.2 Collections framework. </blockquote><DD><DL><DT><B>Parameters:</B><DD><CODE>obj</CODE> - what the component is to be set to.<DD><CODE>index</CODE> - the specified index.<DT><B>See Also: </B><DD><A HREF="../../javax/swing/DefaultListModel.html#set(int, java.lang.Object)"><CODE>set(int,Object)</CODE></A>, <A HREF="../../java/util/Vector.html#setElementAt(java.lang.Object, int)"><CODE>Vector.setElementAt(Object,int)</CODE></A></DL></DD></DL><HR><A NAME="removeElementAt(int)"><!-- --></A><H3>removeElementAt</H3><PRE>public void <B>removeElementAt</B>(int&nbsp;index)</PRE><DL><DD>Deletes the component at the specified index. <p> Throws an <tt>ArrayIndexOutOfBoundsException</tt> if the index  is invalid. <blockquote> <b>Note:</b> Although this method is not deprecated, the preferred    method to use is <tt>remove(int)</tt>, which implements the     <tt>List</tt> interface defined in the 1.2 Collections framework. </blockquote><DD><DL><DT><B>Parameters:</B><DD><CODE>index</CODE> - the index of the object to remove.<DT><B>See Also: </B><DD><A HREF="../../javax/swing/DefaultListModel.html#remove(int)"><CODE>remove(int)</CODE></A>, <A HREF="../../java/util/Vector.html#removeElementAt(int)"><CODE>Vector.removeElementAt(int)</CODE></A></DL></DD></DL><HR><A NAME="insertElementAt(java.lang.Object, int)"><!-- --></A><H3>insertElementAt</H3><PRE>public void <B>insertElementAt</B>(<A HREF="../../java/lang/Object.html">Object</A>&nbsp;obj,                            int&nbsp;index)</PRE><DL><DD>Inserts the specified object as a component in this list at the  specified <code>index</code>. <p> Throws an <tt>ArrayIndexOutOfBoundsException</tt> if the index  is invalid. <blockquote> <b>Note:</b> Although this method is not deprecated, the preferred    method to use is <tt>add(int,Object)</tt>, which implements the     <tt>List</tt> interface defined in the 1.2 Collections framework. </blockquote><DD><DL><DT><B>Parameters:</B><DD><CODE>obj</CODE> - the component to insert.<DD><CODE>index</CODE> - where to insert the new component.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/ArrayIndexOutOfBoundsException.html">ArrayIndexOutOfBoundsException</A></CODE> - if the index was invalid.<DT><B>See Also: </B><DD><A HREF="../../javax/swing/DefaultListModel.html#add(int, java.lang.Object)"><CODE>add(int,Object)</CODE></A>, <A HREF="../../java/util/Vector.html#insertElementAt(java.lang.Object, int)"><CODE>Vector.insertElementAt(Object,int)</CODE></A></DL></DD></DL><HR><A NAME="addElement(java.lang.Object)"><!-- --></A><H3>addElement</H3><PRE>public void <B>addElement</B>(<A HREF="../../java/lang/Object.html">Object</A>&nbsp;obj)</PRE><DL><DD>Adds the specified component to the end of this list.<DD><DL><DT><B>Parameters:</B><DD><CODE>obj</CODE> - the component to be added.<DT><B>See Also: </B><DD><A HREF="../../java/util/Vector.html#addElement(java.lang.Object)"><CODE>Vector.addElement(Object)</CODE></A></DL></DD></DL><HR><A NAME="removeElement(java.lang.Object)"><!-- --></A><H3>removeElement</H3><PRE>public boolean <B>removeElement</B>(<A HREF="../../java/lang/Object.html">Object</A>&nbsp;obj)</PRE><DL><DD>Removes the first (lowest-indexed) occurrence of the argument  from this list.<DD><DL><DT><B>Parameters:</B><DD><CODE>obj</CODE> - the component to be removed.<DT><B>Returns:</B><DD><code>true</code> if the argument was a component of this          list; <code>false</code> otherwise.<DT><B>See Also: </B><DD><A HREF="../../java/util/Vector.html#removeElement(java.lang.Object)"><CODE>Vector.removeElement(Object)</CODE></A></DL></DD></DL><HR><A NAME="removeAllElements()"><!-- --></A><H3>removeAllElements</H3><PRE>public void <B>removeAllElements</B>()</PRE><DL><DD>Removes all components from this list and sets its size to zero. <blockquote> <b>Note:</b> Although this method is not deprecated, the preferred    method to use is <tt>clear()</tt>, which implements the     <tt>List</tt> interface defined in the 1.2 Collections framework. </blockquote><DD><DL><DT><B>See Also: </B><DD><A HREF="../../javax/swing/DefaultListModel.html#clear()"><CODE>clear()</CODE></A>, <A HREF="../../java/util/Vector.html#removeAllElements()"><CODE>Vector.removeAllElements()</CODE></A></DL></DD></DL><HR><A NAME="toString()"><!-- --></A><H3>toString</H3><PRE>public <A HREF="../../java/lang/String.html">String</A> <B>toString</B>()</PRE><DL><DD>Returns a string that displays and identifies this object's properties.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../java/lang/Object.html#toString()">toString</A></CODE> in class <CODE><A HREF="../../java/lang/Object.html">Object</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>a String representation of this object</DL></DD></DL><HR><A NAME="toArray()"><!-- --></A><H3>toArray</H3><PRE>public <A HREF="../../java/lang/Object.html">Object</A>[] <B>toArray</B>()</PRE><DL><DD>Returns an array containing all of the elements in this list in the correct order. <p> Throws an <tt>ArrayStoreException</tt> if the runtime type of the array a is not a supertype of the runtime type of every element in this list.<DD><DL><DT><B>Parameters:</B><DD><CODE>a</CODE> - the array into which the elements of the list are to		be stored, if it is big enough; otherwise, a new array of the 		same runtime type is allocated for this purpose.<DT><B>Returns:</B><DD>an array containing the elements of the list.<DT><B>See Also: </B><DD><A HREF="../../java/util/Vector.html#toArray()"><CODE>Vector.toArray()</CODE></A></DL></DD></DL><HR><A NAME="get(int)"><!-- --></A><H3>get</H3><PRE>public <A HREF="../../java/lang/Object.html">Object</A> <B>get</B>(int&nbsp;index)</PRE><DL><DD>Returns the element at the specified position in this list. <p> Throws an <tt>ArrayIndexOutOfBoundsException</tt> if the index is out of range (index &lt; 0 || index &gt;= size()).<DD><DL><DT><B>Parameters:</B><DD><CODE>index</CODE> - index of element to return.</DL></DD></DL><HR><A NAME="set(int, java.lang.Object)"><!-- --></A><H3>set</H3><PRE>public <A HREF="../../java/lang/Object.html">Object</A> <B>set</B>(int&nbsp;index,                  <A HREF="../../java/lang/Object.html">Object</A>&nbsp;element)</PRE><DL><DD>Replaces the element at the specified position in this list with the specified element. <p> Throws an <tt>ArrayIndexOutOfBoundsException</tt> if the index is out of range (index &lt; 0 || index &gt;= size()).<DD><DL><DT><B>Parameters:</B><DD><CODE>index</CODE> - index of element to replace.<DD><CODE>element</CODE> - element to be stored at the specified position.<DT><B>Returns:</B><DD>the element previously at the specified position.</DL></DD></DL><HR><A NAME="add(int, java.lang.Object)"><!-- --></A><H3>add</H3><PRE>public void <B>add</B>(int&nbsp;index,                <A HREF="../../java/lang/Object.html">Object</A>&nbsp;element)</PRE><DL><DD>Inserts the specified element at the specified position in this list. <p> Throws an <tt>ArrayIndexOutOfBoundsException</tt> if the index is out of range (index &lt; 0 || index &gt;= size()).<DD><DL><DT><B>Parameters:</B><DD><CODE>index</CODE> - index at which the specified element is to be inserted.<DD><CODE>element</CODE> - element to be inserted.</DL></DD></DL><HR><A NAME="remove(int)"><!-- --></A><H3>remove</H3><PRE>public <A HREF="../../java/lang/Object.html">Object</A> <B>remove</B>(int&nbsp;index)</PRE><DL><DD>Removes the element at the specified position in this list. Returns the element that was removed from the list. <p> Throws an <tt>ArrayIndexOutOfBoundsException</tt> if the index is out of range (index &lt; 0 || index &gt;= size()).<DD><DL><DT><B>Parameters:</B><DD><CODE>index</CODE> - the index of the element to removed.</DL></DD></DL><HR><A NAME="clear()"><!-- --></A><H3>clear</H3><PRE>public void <B>clear</B>()</PRE><DL><DD>Removes all of the elements from this list.  The list will be empty after this call returns (unless it throws an exception).</DL><HR><A NAME="removeRange(int, int)"><!-- --></A><H3>removeRange</H3><PRE>public void <B>removeRange</B>(int&nbsp;fromIndex,                        int&nbsp;toIndex)</PRE><DL><DD>Deletes the components at the specified range of indexes. The removal is inclusive, so specifying a range of (1,5) removes the component at index 1 and the component at index 5, as well as all components in between. <p> Throws an <tt>ArrayIndexOutOfBoundsException</tt> if the index was invalid. Throws an <tt>IllegalArgumentException</tt> if <tt>fromIndex</tt> &gt; <tt>toIndex</tt>.<DD><DL><DT><B>Parameters:</B><DD><CODE>fromIndex</CODE> - the index of the lower end of the range<DD><CODE>toIndex</CODE> - the index of the upper end of the range<DT><B>See Also: </B><DD><A HREF="../../javax/swing/DefaultListModel.html#remove(int)"><CODE>remove(int)</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>&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/DefaultListModel.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-files/index-1.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><b>Java<sup><font size=-2>TM</font></sup>&nbsp;2&nbsp;Platform<br>Std.&nbsp;Ed. v1.3</b></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">&nbsp;<A HREF="../../javax/swing/DefaultListCellRenderer.UIResource.html"><B>PREV CLASS</B></A>&nbsp;&nbsp;<A HREF="../../javax/swing/DefaultListSelectionModel.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;&nbsp;<A HREF="DefaultListModel.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">  SUMMARY: &nbsp;INNER&nbsp;|&nbsp;<A HREF="#fields_inherited_from_class_javax.swing.AbstractListModel">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: &nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><!-- =========== END OF NAVBAR =========== --><HR><font size="-1"><a href="http://java.sun.com/cgi-bin/bugreport.cgi">Submit a bug or feature</a><br>For further API reference and developer documentation, see <a href="http://java.sun.com/products/jdk/1.3/devdocs-vs-specs.html">Java 2 SDK SE Developer Documentation</a>. That documentation  contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples. <p>Java, Java 2D, and JDBC are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries.<br>Copyright 1993-2000 Sun Microsystems, Inc. 901 San Antonio Road<br>Palo Alto, California, 94303, U.S.A.  All Rights Reserved.</font></BODY></HTML>

⌨️ 快捷键说明

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