Demos and Usage of javax.swing.table.DefaultTableModel.getRowCount()


   1: import javax.swing.JScrollPane;
   2: import javax.swing.table.DefaultTableModel;
   3: 
   4:         ...
   5: 
   6:         DefaultTableModel tableModel =
   7:         ...
   8:             new DefaultTableModel(new Object[][] {
   9:                 new Object[] { "Row1-1", "Row1-2", "Row1-3", "Row1-4" },
  10:         ...
  11:         Assert.assertEquals(4, disableColumnsTableModel.getColumnCount());
  12:         Assert.assertEquals(tableModel.getRowCount(), disableColumnsTableModel.getRowCount());

View Full Code Here
   1:     JTable table = null;
   2:     DefaultTableModel defaultModel = null;
   3: 
   4:         ...
   5:                      
   6:            defaultModel = new DefaultTableModel(data,name);
   7:            table=new JTable(defaultModel);
   8:         ...
   9:         {
  10:             int rowcount = defaultModel.getRowCount()-1;
  11:             if(rowcount >= 0)

View Full Code Here
   1: 
   2:       DefaultTableModel model = new DefaultTableModel(cells, columnNames);
   3:       final SortFilterModel sorter = new SortFilterModel(model);
   4:         ...
   5:       model = m;
   6:       rows = new Row[model.getRowCount()];
   7:       for (int i = 0; i < rows.length; i++)
   8:         ...
   9: 
  10:    public int getRowCount() { return model.getRowCount(); }
  11:    public int getColumnCount() { return model.getColumnCount(); }

View Full Code Here
   1: 
   2:       model = new DefaultTableModel(10, 10);
   3: 
   4:         ...
   5:       for (int i = 0; i < model.getRowCount(); i++)
   6:          for (int j = 0; j < model.getColumnCount(); j++)
   7:         ...
   8:                for (int i = 0; i < newCells.length; i++)
   9:                   newCells[i] = (i + 1) * (model.getRowCount() + 1);
  10:                model.addRow(newCells);
  11:         ...
  12:             {
  13:                for (int i = 0; i < table.getRowCount(); i++)

View Full Code Here
   1: 
   2:             DefaultTableModel tm = (DefaultTableModel) this.tab.getModel();
   3: 
   4:         ...
   5:             }
   6:             int numRows = tm.getRowCount();
   7:             tm.fireTableRowsInserted(0, numRows);
   8:         }
   9:         catch(Exception ex)

View Full Code Here
   1:   JTable                      table;
   2:   DefaultTableModel           model;
   3:   String                      seqString    = "";
   4:         ...
   5: 
   6:   class SeqMatchModel extends DefaultTableModel {
   7:     public Class getColumnClass(int c) {
   8:         ...
   9:   protected void populateTable() {
  10:     int    nrow     = model.getRowCount();

View Full Code Here
   1:   private BuTable tb_sup;
   2:   private DefaultTableModel dm_tb_sup;
   3:   BuButton bt_add;
   4:         ...
   5:     dm_tb_sup.addRow((Object[])OscarLib.EmptyRow(dm_tb_sup.getColumnCount()));
   6:     if (dm_tb_sup.getRowCount() > 0) {
   7:       bt_del.setEnabled(true);
   8:         ...
   9:       tb_sup.setRowSelectionInterval(
  10:         dm_tb_sup.getRowCount() - 1,
  11:         ...
  12:         dm_tb_sup.getRowCount() - 1);

View Full Code Here
   1:   private BuTable tb_sup;
   2:   private DefaultTableModel dm_tb_sup;
   3:   BuButton bt_add;
   4:         ...
   5:     dm_tb_sup.addRow((Object[])OscarLib.EmptyRow(dm_tb_sup.getColumnCount()));
   6:     if (dm_tb_sup.getRowCount() > 0) {
   7:       bt_del.setEnabled(true);
   8:         ...
   9:       tb_sup.setRowSelectionInterval(
  10:         dm_tb_sup.getRowCount() - 1,
  11:         ...
  12:         dm_tb_sup.getRowCount() - 1);

View Full Code Here
   1:   private BuTable tb_fdiag;
   2:   private DefaultTableModel dm_tb_fdiag;
   3:   BuButton bt_add;
   4:         ...
   5:   private void ajouterFichier() {
   6:     if (tb_fdiag.getRowCount()
   7:       >= OscarLib.EFFORTS_NOMBRE_FICHIERS_DIAGRAMMES_MAXI) {
   8:         ...
   9:     tb_fdiag.setRowSelectionInterval(
  10:       tb_fdiag.getRowCount() - 1,
  11:         ...
  12:       tb_fdiag.getRowCount() - 1);

View Full Code Here
   1:   BuButton bt_courbe_;
   2:   DefaultTableModel dm_tb_efforts_;
   3:   public OscarEffortsTranchantsResultatsBruts(
   4:         ...
   5:   public int getNbPointEffortsTranchants() {
   6:     return tb_efforts_.getRowCount();
   7:   }
   8:         ...
   9:         new Double(_p.pointsCoteEffort[i].cote),
  10:         dm_tb_efforts_.getRowCount() - 1,
  11:         0);
  12:         ...
  13:         new Double(_p.pointsCoteEffort[i].valeur),
  14:         dm_tb_efforts_.getRowCount() - 1,

View Full Code Here
   1:   BuButton bt_courbe_;
   2:   DefaultTableModel dm_tb_moments_;
   3:   public OscarMomentsFlechissantsResultatsBruts(
   4:         ...
   5:   public int getNbPointMomentsFlechissants() {
   6:     return tb_moments_.getRowCount();
   7:   }
   8:         ...
   9:         new Double(_p.pointsCoteMoment[i].cote),
  10:         dm_tb_moments_.getRowCount() - 1,
  11:         0);
  12:         ...
  13:         new Double(_p.pointsCoteMoment[i].valeur),
  14:         dm_tb_moments_.getRowCount() - 1,

View Full Code Here
   1: import javax.swing.JScrollPane;
   2: import javax.swing.table.DefaultTableModel;
   3: import javax.swing.event.ChangeListener;
   4:         ...
   5:   private BuTable tb_pressions_;
   6:   private DefaultTableModel dm_tb_pressions_;
   7:   private BuButton bt_imprimer_;
   8:         ...
   9:   public int getNbPointDiagrammePressions() {
  10:     int _n= tb_pressions_.getRowCount();
  11:     return _n;
  12:         ...
  13:         new Double(_p.pointsCotePression[i].cote),
  14:         dm_tb_pressions_.getRowCount() - 1,

View Full Code Here
   1: import javax.swing.JTable;
   2: import javax.swing.table.DefaultTableModel;
   3: import javax.swing.event.ChangeListener;
   4:         ...
   5:   private BuTable tb_deformee_;
   6:   private DefaultTableModel dm_tb_deformee_;
   7:   private BuButton bt_imprimer_;
   8:         ...
   9:   public int getNbPointDeformees() {
  10:     return tb_deformee_.getRowCount();
  11:   }
  12:         ...
  13:         new Double(_p.pointsCoteDeformee[i].cote),
  14:         dm_tb_deformee_.getRowCount() - 1,

View Full Code Here
   1:   private void updateMainGroupModel() {
   2:     DefaultTableModel model = (DefaultTableModel)jTable.getModel();
   3:     PeerGroupID[] groups = mainGroupModel.getJobGroups();
   4:         ...
   5:     for (int i = 0; i < groups.length; i++) {
   6:       int rows = model.getRowCount(), j = 0;
   7:       JobGroupModel jobGroupModel = mainGroupModel.getJobGroupModel(groups[i]);
   8:         ...
   9: 
  10:     DefaultTableModel tableModel = new JobGroupTableModel(new Object[] {
  11:     "Name", "Timestamp"

View Full Code Here
   1:   private BuTable tb_couches_;
   2:   private DefaultTableModel dm_tb_couches_;
   3:   private BuPanel b1_;
   4:         ...
   5:     tb_couches_.setValueAt(
   6:       new Integer(dm_tb_couches_.getRowCount()),
   7:         ...
   8:       dm_tb_couches_.getRowCount() - 1,
   9:       0);
  10:         ...
  11:     if (dm_tb_couches_.getRowCount() > 0) {

View Full Code Here