defaulttablemodel.html

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

HTML
1,161
字号
<HR><A NAME="addRow(java.util.Vector)"><!-- --></A><H3>addRow</H3><PRE>public void <B>addRow</B>(<A HREF="../../../java/util/Vector.html">Vector</A>&nbsp;rowData)</PRE><DL><DD>Adds a row to the end of the model.  The new row will contain  <code>null</code> values unless <code>rowData</code> is specified.  Notification of the row being added will be generated.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>rowData</CODE> - optional data of the row being added</DL></DD></DL><HR><A NAME="addRow(java.lang.Object[])"><!-- --></A><H3>addRow</H3><PRE>public void <B>addRow</B>(<A HREF="../../../java/lang/Object.html">Object</A>[]&nbsp;rowData)</PRE><DL><DD>Adds a row to the end of the model.  The new row will contain  <code>null</code> values unless <code>rowData</code> is specified.  Notification of the row being added will be generated.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>rowData</CODE> - optional data of the row being added</DL></DD></DL><HR><A NAME="insertRow(int, java.util.Vector)"><!-- --></A><H3>insertRow</H3><PRE>public void <B>insertRow</B>(int&nbsp;row,                      <A HREF="../../../java/util/Vector.html">Vector</A>&nbsp;rowData)</PRE><DL><DD>Inserts a row at <code>row</code> in the model.  The new row  will contain <code>null</code> values unless <code>rowData</code>  is specified.  Notification of the row being added will be generated.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>row</CODE> - the row index of the row to be inserted<DD><CODE>rowData</CODE> - optional data of the row being added<DT><B>Throws:</B><DD><CODE><A HREF="../../../java/lang/ArrayIndexOutOfBoundsException.html">ArrayIndexOutOfBoundsException</A></CODE> - if the row was invalid</DL></DD></DL><HR><A NAME="insertRow(int, java.lang.Object[])"><!-- --></A><H3>insertRow</H3><PRE>public void <B>insertRow</B>(int&nbsp;row,                      <A HREF="../../../java/lang/Object.html">Object</A>[]&nbsp;rowData)</PRE><DL><DD>Inserts a row at <code>row</code> in the model.  The new row  will contain <code>null</code> values unless <code>rowData</code>  is specified.  Notification of the row being added will be generated.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>row</CODE> - the row index of the row to be inserted<DD><CODE>rowData</CODE> - optional data of the row being added<DT><B>Throws:</B><DD><CODE><A HREF="../../../java/lang/ArrayIndexOutOfBoundsException.html">ArrayIndexOutOfBoundsException</A></CODE> - if the row was invalid</DL></DD></DL><HR><A NAME="moveRow(int, int, int)"><!-- --></A><H3>moveRow</H3><PRE>public void <B>moveRow</B>(int&nbsp;startIndex,                    int&nbsp;endIndex,                    int&nbsp;toIndex)</PRE><DL><DD>Moves one or more rows starting at <code>startIndex</code>  to <code>endIndex</code> in the model to the <code>toIndex</code>.  This method will send a <code>tableChanged</code> notification  message to all the listeners. <p> <pre>  Examples of moves:<p>  1. moveRow(1,3,5);<p>          a|B|C|D|e|f|g|h|i|j|k   - before          a|e|f|B|C|D|g|h|i|j|k   - after<p>  2. moveRow(6,7,1);<p>          a|b|c|d|e|f|G|H|i|j|k   - before          a|G|H|b|c|d|e|f|i|j|k   - after </pre><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>startIndex</CODE> - the starting row index to be moved<DD><CODE>endIndex</CODE> - the ending row index to be moved<DD><CODE>toIndex</CODE> - the destination of the rows to be moved<DT><B>Throws:</B><DD><CODE><A HREF="../../../java/lang/ArrayIndexOutOfBoundsException.html">ArrayIndexOutOfBoundsException</A></CODE> - if any of the indices                           are out of range; or if <code>endIndex</code>				 is less than <code>startIndex</code></DL></DD></DL><HR><A NAME="removeRow(int)"><!-- --></A><H3>removeRow</H3><PRE>public void <B>removeRow</B>(int&nbsp;row)</PRE><DL><DD>Removes the row at <code>row</code> from the model.  Notification  of the row being removed will be sent to all the listeners.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>row</CODE> - the row index of the row to be removed<DT><B>Throws:</B><DD><CODE><A HREF="../../../java/lang/ArrayIndexOutOfBoundsException.html">ArrayIndexOutOfBoundsException</A></CODE> - if the row was invalid</DL></DD></DL><HR><A NAME="getRowCount()"><!-- --></A><H3>getRowCount</H3><PRE>public int <B>getRowCount</B>()</PRE><DL><DD>Returns the number of rows in this data table.<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the number of rows in the model</DL></DD></DL><HR><A NAME="getColumnCount()"><!-- --></A><H3>getColumnCount</H3><PRE>public int <B>getColumnCount</B>()</PRE><DL><DD>Returns the number of columns in this data table.<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the number of columns in the model</DL></DD></DL><HR><A NAME="getColumnName(int)"><!-- --></A><H3>getColumnName</H3><PRE>public <A HREF="../../../java/lang/String.html">String</A> <B>getColumnName</B>(int&nbsp;column)</PRE><DL><DD>Returns the column name.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../javax/swing/table/AbstractTableModel.html#getColumnName(int)">getColumnName</A></CODE> in class <CODE><A HREF="../../../javax/swing/table/AbstractTableModel.html">AbstractTableModel</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>a name for this column using the string value of the appropriate member in <code>columnIdentifiers</code>. If <code>columnIdentifiers</code> is <code>null</code> or does not have an entry for this index, returns the default name provided by the superclass</DL></DD></DL><HR><A NAME="isCellEditable(int, int)"><!-- --></A><H3>isCellEditable</H3><PRE>public boolean <B>isCellEditable</B>(int&nbsp;row,                              int&nbsp;column)</PRE><DL><DD>Returns true regardless of parameter values.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../javax/swing/table/AbstractTableModel.html#isCellEditable(int, int)">isCellEditable</A></CODE> in class <CODE><A HREF="../../../javax/swing/table/AbstractTableModel.html">AbstractTableModel</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>row</CODE> - the row whose value is to be queried<DD><CODE>column</CODE> - the column whose value is to be queried<DT><B>Returns:</B><DD>true<DT><B>See Also: </B><DD><A HREF="../../../javax/swing/table/DefaultTableModel.html#setValueAt(java.lang.Object, int, int)"><CODE>setValueAt(java.lang.Object, int, int)</CODE></A></DL></DD></DL><HR><A NAME="getValueAt(int, int)"><!-- --></A><H3>getValueAt</H3><PRE>public <A HREF="../../../java/lang/Object.html">Object</A> <B>getValueAt</B>(int&nbsp;row,                         int&nbsp;column)</PRE><DL><DD>Returns an attribute value for the cell at <code>row</code> and <code>column</code>.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>row</CODE> - the row whose value is to be queried<DD><CODE>column</CODE> - the column whose value is to be queried<DT><B>Returns:</B><DD>the value Object at the specified cell<DT><B>Throws:</B><DD><CODE><A HREF="../../../java/lang/ArrayIndexOutOfBoundsException.html">ArrayIndexOutOfBoundsException</A></CODE> - if an invalid row or               column was given</DL></DD></DL><HR><A NAME="setValueAt(java.lang.Object, int, int)"><!-- --></A><H3>setValueAt</H3><PRE>public void <B>setValueAt</B>(<A HREF="../../../java/lang/Object.html">Object</A>&nbsp;aValue,                       int&nbsp;row,                       int&nbsp;column)</PRE><DL><DD>Sets the object value for the cell at <code>column</code> and <code>row</code>.  <code>aValue</code> is the new value.  This method will generate a <code>tableChanged</code> notification.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../javax/swing/table/AbstractTableModel.html#setValueAt(java.lang.Object, int, int)">setValueAt</A></CODE> in class <CODE><A HREF="../../../javax/swing/table/AbstractTableModel.html">AbstractTableModel</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>aValue</CODE> - the new value; this can be null<DD><CODE>row</CODE> - the row whose value is to be changed<DD><CODE>column</CODE> - the column whose value is to be changed<DT><B>Throws:</B><DD><CODE><A HREF="../../../java/lang/ArrayIndexOutOfBoundsException.html">ArrayIndexOutOfBoundsException</A></CODE> - if an invalid row or               column was given</DL></DD></DL><HR><A NAME="convertToVector(java.lang.Object[])"><!-- --></A><H3>convertToVector</H3><PRE>protected static <A HREF="../../../java/util/Vector.html">Vector</A> <B>convertToVector</B>(<A HREF="../../../java/lang/Object.html">Object</A>[]&nbsp;anArray)</PRE><DL><DD>Returns a vector that contains the same objects as the array.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>anArray</CODE> - the array to be converted<DT><B>Returns:</B><DD>the new vector; if <code>anArray</code> is <code>null</code>,				returns <code>null</code></DL></DD></DL><HR><A NAME="convertToVector(java.lang.Object[][])"><!-- --></A><H3>convertToVector</H3><PRE>protected static <A HREF="../../../java/util/Vector.html">Vector</A> <B>convertToVector</B>(<A HREF="../../../java/lang/Object.html">Object</A>[][]&nbsp;anArray)</PRE><DL><DD>Returns a vector of vectors that contains the same objects as the array.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>anArray</CODE> - the double array to be converted<DT><B>Returns:</B><DD>the new vector of vectors; if <code>anArray</code> is				<code>null</code>, returns <code>null</code></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/DefaultTableModel.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/table/DefaultTableColumnModel.html"><B>PREV CLASS</B></A>&nbsp;&nbsp;<A HREF="../../../javax/swing/table/JTableHeader.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="DefaultTableModel.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="#field_summary">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;<A HREF="#field_detail">FIELD</A>&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 + =
减小字号Ctrl + -
显示快捷键?