Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<blockquote> <p>The TableModel interface defines the how the data can interact with the JTable. There are two classes that implement the TableModel interface - the DefaultTableModel and the AbstractTableModel. The AbstractTableModel implements the majority of the methods defined in the TableModel interface and leaves three methods (getRowCount, getColumnCount, getValueAt) which must be implemented by a subclass. It's the basis for any custom table model a programmer might create. The DefaultTableModel class is such an implementation. It is a subclass of the AbstractTableModel with the three methods implemented where the data is stored in <strong>a Vector of Vectors</strong>. </p> <p>By using your own custom table model built from the AbstractTableModel you can choose to store the data however you want to but you'll need to implement the methods that allow the data to interact with the JTable seamlessly. How many methods will depend on how much the JTable needs to manage the data. For a read-only JTable then the three default methods mentioned above are enough. But for a JTable that allows extensively editing (e.g., adding and removing rows and columns) then these methods will need to implemented to reflect the changes in the data that's been stored in the table model.</p> </blockquote> <p>Courtesy - <a href="http://java.about.com/od/Creating-Tables/a/The-Jtable-Table-Model.htm" rel="nofollow">http://java.about.com/od/Creating-Tables/a/The-Jtable-Table-Model.htm</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload