src/share/classes/javax/swing/table/TableModel.java

Print this page




  23  * questions.
  24  */
  25 
  26 package javax.swing.table;
  27 
  28 import javax.swing.*;
  29 import javax.swing.event.*;
  30 
  31 /**
  32  *  The <code>TableModel</code> interface specifies the methods the
  33  *  <code>JTable</code> will use to interrogate a tabular data model. <p>
  34  *
  35  *  The <code>JTable</code> can be set up to display any data
  36  *  model which implements the
  37  *  <code>TableModel</code> interface with a couple of lines of code:  <p>
  38  *  <pre>
  39  *      TableModel myData = new MyTableModel();
  40  *      JTable table = new JTable(myData);
  41  *  </pre><p>
  42  *
  43  * For further documentation, see <a href="http://java.sun.com/docs/books/tutorial/uiswing/components/table.html#data">Creating a Table Model</a>
  44  * in <em>The Java Tutorial</em>.
  45  * <p>
  46  * @author Philip Milne
  47  * @see JTable
  48  */
  49 
  50 public interface TableModel
  51 {
  52     /**
  53      * Returns the number of rows in the model. A
  54      * <code>JTable</code> uses this method to determine how many rows it
  55      * should display.  This method should be quick, as it
  56      * is called frequently during rendering.
  57      *
  58      * @return the number of rows in the model
  59      * @see #getColumnCount
  60      */
  61     public int getRowCount();
  62 
  63     /**




  23  * questions.
  24  */
  25 
  26 package javax.swing.table;
  27 
  28 import javax.swing.*;
  29 import javax.swing.event.*;
  30 
  31 /**
  32  *  The <code>TableModel</code> interface specifies the methods the
  33  *  <code>JTable</code> will use to interrogate a tabular data model. <p>
  34  *
  35  *  The <code>JTable</code> can be set up to display any data
  36  *  model which implements the
  37  *  <code>TableModel</code> interface with a couple of lines of code:  <p>
  38  *  <pre>
  39  *      TableModel myData = new MyTableModel();
  40  *      JTable table = new JTable(myData);
  41  *  </pre><p>
  42  *
  43  * For further documentation, see <a href="http://docs.oracle.com/javase/tutorial/uiswing/components/table.html#data">Creating a Table Model</a>
  44  * in <em>The Java Tutorial</em>.
  45  * <p>
  46  * @author Philip Milne
  47  * @see JTable
  48  */
  49 
  50 public interface TableModel
  51 {
  52     /**
  53      * Returns the number of rows in the model. A
  54      * <code>JTable</code> uses this method to determine how many rows it
  55      * should display.  This method should be quick, as it
  56      * is called frequently during rendering.
  57      *
  58      * @return the number of rows in the model
  59      * @see #getColumnCount
  60      */
  61     public int getRowCount();
  62 
  63     /**