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

📄 defaultlistmodel.html

📁 API資料大全
💻 HTML
📖 第 1 页 / 共 3 页
字号:
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Removes the first (lowest-indexed) occurrence of the argument  from this list.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/DefaultListModel.html#removeElementAt(int)">removeElementAt</A></B>(int&nbsp;index)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Deletes the component at the specified index.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/DefaultListModel.html#removeRange(int, int)">removeRange</A></B>(int&nbsp;fromIndex,            int&nbsp;toIndex)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Deletes the components at the specified range of indexes.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../java/lang/Object.html">Object</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/DefaultListModel.html#set(int, java.lang.Object)">set</A></B>(int&nbsp;index,    <A HREF="../../java/lang/Object.html">Object</A>&nbsp;element)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Replaces the element at the specified position in this list with the specified element.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/DefaultListModel.html#setElementAt(java.lang.Object, int)">setElementAt</A></B>(<A HREF="../../java/lang/Object.html">Object</A>&nbsp;obj,             int&nbsp;index)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the component at the specified <code>index</code> of this  list to be the specified object.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/DefaultListModel.html#setSize(int)">setSize</A></B>(int&nbsp;newSize)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the size of this list.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;int</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/DefaultListModel.html#size()">size</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the number of components in this list.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../java/lang/Object.html">Object</A>[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/DefaultListModel.html#toArray()">toArray</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns an array containing all of the elements in this list in the correct order.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../java/lang/String.html">String</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/DefaultListModel.html#toString()">toString</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a string that displays and identifies this object's properties.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/DefaultListModel.html#trimToSize()">trimToSize</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Trims the capacity of this list to be the list's current size.</TD></TR></TABLE>&nbsp;<A NAME="methods_inherited_from_class_javax.swing.AbstractListModel"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Methods inherited from class javax.swing.<A HREF="../../javax/swing/AbstractListModel.html">AbstractListModel</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../../javax/swing/AbstractListModel.html#addListDataListener(javax.swing.event.ListDataListener)">addListDataListener</A>, <A HREF="../../javax/swing/AbstractListModel.html#fireContentsChanged(java.lang.Object, int, int)">fireContentsChanged</A>, <A HREF="../../javax/swing/AbstractListModel.html#fireIntervalAdded(java.lang.Object, int, int)">fireIntervalAdded</A>, <A HREF="../../javax/swing/AbstractListModel.html#fireIntervalRemoved(java.lang.Object, int, int)">fireIntervalRemoved</A>, <A HREF="../../javax/swing/AbstractListModel.html#getListeners(java.lang.Class)">getListeners</A>, <A HREF="../../javax/swing/AbstractListModel.html#removeListDataListener(javax.swing.event.ListDataListener)">removeListDataListener</A></CODE></TD></TR></TABLE>&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Methods inherited from class java.lang.<A HREF="../../java/lang/Object.html">Object</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../../java/lang/Object.html#clone()">clone</A>, <A HREF="../../java/lang/Object.html#equals(java.lang.Object)">equals</A>, <A HREF="../../java/lang/Object.html#finalize()">finalize</A>, <A HREF="../../java/lang/Object.html#getClass()">getClass</A>, <A HREF="../../java/lang/Object.html#hashCode()">hashCode</A>, <A HREF="../../java/lang/Object.html#notify()">notify</A>, <A HREF="../../java/lang/Object.html#notifyAll()">notifyAll</A>, <A HREF="../../java/lang/Object.html#wait()">wait</A>, <A HREF="../../java/lang/Object.html#wait(long)">wait</A>, <A HREF="../../java/lang/Object.html#wait(long, int)">wait</A></CODE></TD></TR></TABLE>&nbsp;<P><!-- ============ FIELD DETAIL =========== --><!-- ========= CONSTRUCTOR DETAIL ======== --><A NAME="constructor_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Constructor Detail</B></FONT></TD></TR></TABLE><A NAME="DefaultListModel()"><!-- --></A><H3>DefaultListModel</H3><PRE>public <B>DefaultListModel</B>()</PRE><DL></DL><!-- ============ METHOD DETAIL ========== --><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="getSize()"><!-- --></A><H3>getSize</H3><PRE>public int <B>getSize</B>()</PRE><DL><DD>Returns the number of components in this list. <p> This method is identical to <tt>size()</tt>, which implements the  <tt>List</tt> interface defined in the 1.2 Collections framework. This method exists in conjunction with <tt>setSize()</tt> so that "size" is identifiable as a JavaBean property.<DD><DL><DT><B>Returns:</B><DD>the number of components in this list.<DT><B>See Also: </B><DD><A HREF="../../javax/swing/DefaultListModel.html#size()"><CODE>size()</CODE></A></DL></DD></DL><HR><A NAME="getElementAt(int)"><!-- --></A><H3>getElementAt</H3><PRE>public <A HREF="../../java/lang/Object.html">Object</A> <B>getElementAt</B>(int&nbsp;index)</PRE><DL><DD>Returns the component at the specified index. <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>Throws:</B><DD><CODE><A HREF="../../java/lang/ArrayIndexOutOfBoundsException.html">ArrayIndexOutOfBoundsException</A></CODE> - if the <tt>index</tt>              is negative or not less than the current size of this              list.             given.<DT><B>See Also: </B><DD><A HREF="../../javax/swing/DefaultListModel.html#get(int)"><CODE>get(int)</CODE></A></DL></DD></DL><HR><A NAME="copyInto(java.lang.Object[])"><!-- --></A><H3>copyInto</H3><PRE>public void <B>copyInto</B>(<A HREF="../../java/lang/Object.html">Object</A>[]&nbsp;anArray)</PRE><DL><DD>Copies the components of this list into the specified array. The array must be big enough to hold all the objects in this list,  else an <tt>IndexOutOfBoundsException</tt> is thrown.<DD><DL><DT><B>Parameters:</B><DD><CODE>anArray</CODE> - the array into which the components get copied.<DT><B>See Also: </B><DD><A HREF="../../java/util/Vector.html#copyInto(java.lang.Object[])"><CODE>Vector.copyInto(Object[])</CODE></A></DL></DD></DL><HR><A NAME="trimToSize()"><!-- --></A><H3>trimToSize</H3><PRE>public void <B>trimToSize</B>()</PRE><DL><DD>Trims the capacity of this list to be the list's current size.<DD><DL><DT><B>See Also: </B><DD><A HREF="../../java/util/Vector.html#trimToSize()"><CODE>Vector.trimToSize()</CODE></A></DL></DD></DL><HR><A NAME="ensureCapacity(int)"><!-- --></A><H3>ensureCapacity</H3><PRE>public void <B>ensureCapacity</B>(int&nbsp;minCapacity)</PRE><DL><DD>Increases the capacity of this list, if necessary, to ensure  that it can hold at least the number of components specified by  the minimum capacity argument.<DD><DL><DT><B>Parameters:</B><DD><CODE>minCapacity</CODE> - the desired minimum capacity.<DT><B>See Also: </B><DD><A HREF="../../java/util/Vector.html#ensureCapacity(int)"><CODE>Vector.ensureCapacity(int)</CODE></A></DL></DD></DL><HR><A NAME="setSize(int)"><!-- --></A><H3>setSize</H3><PRE>public void <B>setSize</B>(int&nbsp;newSize)</PRE><DL><DD>Sets the size of this list.<DD><DL><DT><B>Parameters:</B><DD><CODE>newSize</CODE> - the new size of this list.<DT><B>See Also: </B><DD><A HREF="../../java/util/Vector.html#setSize(int)"><CODE>Vector.setSize(int)</CODE></A></DL></DD></DL><HR><A NAME="capacity()"><!-- --></A><H3>capacity</H3><PRE>public int <B>capacity</B>()</PRE><DL><DD>Returns the current capacity of this list.<DD><DL><DT><B>Returns:</B><DD>the current capacity<DT><B>See Also: </B><DD><A HREF="../../java/util/Vector.html#capacity()"><CODE>Vector.capacity()</CODE></A></DL></DD></DL><HR><A NAME="size()"><!-- --></A><H3>size</H3><PRE>public int <B>size</B>()</PRE><DL><DD>Returns the number of components in this list.<DD><DL><DT><B>Returns:</B><DD>the number of components in this list.<DT><B>See Also: </B><DD><A HREF="../../java/util/Vector.html#size()"><CODE>Vector.size()</CODE></A></DL></DD></DL><HR><A NAME="isEmpty()"><!-- --></A><H3>isEmpty</H3><PRE>public boolean <B>isEmpty</B>()</PRE><DL><DD>Tests if this list has no components.<DD><DL><DT><B>Returns:</B><DD><code>true</code> if and only if this list has           no components, that is, its size is zero;          <code>false</code> otherwise.<DT><B>See Also: </B><DD><A HREF="../../java/util/Vector.html#isEmpty()"><CODE>Vector.isEmpty()</CODE></A></DL></DD></DL><HR><A NAME="elements()"><!-- --></A><H3>elements</H3><PRE>public <A HREF="../../java/util/Enumeration.html">Enumeration</A> <B>elements</B>()</PRE><DL><DD>Returns an enumeration of the components of this list.<DD><DL><DT><B>Returns:</B><DD>an enumeration of the components of this list.<DT><B>See Also: </B><DD><A HREF="../../java/util/Vector.html#elements()"><CODE>Vector.elements()</CODE></A></DL></DD></DL><HR><A NAME="contains(java.lang.Object)"><!-- --></A><H3>contains</H3><PRE>public boolean <B>contains</B>(<A HREF="../../java/lang/Object.html">Object</A>&nbsp;elem)</PRE><DL><DD>Tests if the specified object is a component in this list.<DD><DL><DT><B>Parameters:</B><DD><CODE>elem</CODE> - an object.<DT><B>Returns:</B><DD><code>true</code> if the specified object           is the same as a component in this list<DT><B>See Also: </B><DD><A HREF="../../java/util/Vector.html#contains(java.lang.Object)"><CODE>Vector.contains(Object)</CODE></A></DL></DD></DL><HR><A NAME="indexOf(java.lang.Object)"><!-- --></A><H3>indexOf</H3><PRE>public int <B>indexOf</B>(<A HREF="../../java/lang/Object.html">Object</A>&nbsp;elem)</PRE><DL><DD>Searches for the first occurence of the given argument.<DD><DL><DT><B>Parameters:</B><DD><CODE>elem</CODE> - an object.<DT><B>Returns:</B><DD>the index of the first occurrence of the argument in this          list; returns <code>-1</code> if the object is not found.<DT><B>See Also: </B><DD><A HREF="../../java/util/Vector.html#indexOf(java.lang.Object)"><CODE>Vector.indexOf(Object)</CODE></A></DL></DD></DL><HR><A NAME="indexOf(java.lang.Object, int)"><!-- --></A><H3>indexOf</H3><PRE>public int <B>indexOf</B>(<A HREF="../../java/lang/Object.html">Object</A>&nbsp;elem,                   int&nbsp;index)</PRE><DL><DD>Searches for the first occurence of the given argument, beginning  the search at <code>index</code>.<DD><DL><DT><B>Parameters:</B><DD><CODE>elem</CODE> - an object.<DD><CODE>index</CODE> - the index to start searching from.<DT><B>Returns:</B><DD>the index of the first occurrence of the object argument in          this list at position <code>index</code> or later in the          list; returns <code>-1</code> if the object is not found.<DT><B>See Also: </B><DD><A HREF="../../java/util/Vector.html#indexOf(java.lang.Object, int)"><CODE>Vector.indexOf(Object,int)</CODE></A></DL></DD></DL><HR><A NAME="lastIndexOf(java.lang.Object)"><!-- --></A><H3>lastIndexOf</H3><PRE>public int <B>lastIndexOf</B>(<A HREF="../../java/lang/Object.html">Object</A>&nbsp;elem)</PRE><DL><DD>Returns the index of the last occurrence of the specified object in this list.<DD><DL><DT><B>Parameters:</B><DD><CODE>elem</CODE> - the desired component.<DT><B>Returns:</B><DD>the index of the last occurrence of the specified object in          this list; returns <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)"><CODE>Vector.lastIndexOf(Object)</CODE></A></DL></DD></DL><HR><A NAME="lastIndexOf(java.lang.Object, int)"><!-- --></A><H3>lastIndexOf</H3><PRE>public int <B>lastIndexOf</B>(<A HREF="../../java/lang/Object.html">Object</A>&nbsp;elem,                       int&nbsp;index)</PRE><DL><DD>Searches backwards for the specified object, starting from the  specified index, and returns an index to it.<DD><DL>

⌨️ 快捷键说明

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