5100 Assignment2 new/5100 Assignment2/src/UI/viewJPanel.java
public void refreshTable() {
    DefaultTableModel model = (DefaultTableModel)table1.getModel();
        model.setRowCount(0);
        for(Product p:catalog.getCatalog()){
            //System.out.println(p.getSerialNumber());
            Object[] row = new Object[9];
            row[0] = p;
            row[1] = p.getSerialNumber();
            row[2] = p.getModelNumber();
            row[3] = p.getProduceYear();
            row[4] = p.getSeatNumbers();
            row[5] = p.getCity();
            row[6] = p.getManufacturers();
            if(p.isIsAvailable() == true){
                row[7] = "Yes";
            }else{
                row[7] = "No";
            }
            if(p.isIsExpired() == true){
                row[8] = "Yes";
            }else{
                row[8] = "No";
            }
         
            model.addRow(row);
        }
    }
// End of variables declaration//GEN-END:variables
End of variables declaration//GEN-END:variables
End of variables declaration // GEN - END : variables
public void refreshTable() {
    DefaultTableModel model = (DefaultTableModel)table1.getModel();
        model.setRowCount(0);
        for(Product p:catalog.getCatalog()){
            Object[] row = new Object[9];
            row[0] = p;
            row[1] = p.getSerialNumber();
            row[2] = p.getModelNumber();
            row[3] = p.getProduceYear();
            row[4] = p.getSeatNumbers();
            row[5] = p.getCity();
            row[6] = p.getManufacturers();
            if(p.isIsAvailable() == true){
                row[7] = "Yes";
            }else{
                row[7] = "No";
            }
            if(p.isIsExpired() == true){
                row[8] = "Yes";
            }else{
                row[8] = "No";
            }
            model.addRow(row);
        }
    }
public void refreshTable ( ) { DefaultTableModel model = ( DefaultTableModel ) table1 . getModel ( ) ; model . setRowCount ( 0 ) ; for ( Product p : catalog . getCatalog ( ) ) { Object [ ] row = new Object [ 9 ] ; row [ 0 ] = p ; row [ 1 ] = p . getSerialNumber ( ) ; row [ 2 ] = p . getModelNumber ( ) ; row [ 3 ] = p . getProduceYear ( ) ; row [ 4 ] = p . getSeatNumbers ( ) ; row [ 5 ] = p . getCity ( ) ; row [ 6 ] = p . getManufacturers ( ) ; if ( p . isIsAvailable ( ) == true ) { row [ 7 ] = "Yes" ; } else { row [ 7 ] = "No" ; } if ( p . isIsExpired ( ) == true ) { row [ 8 ] = "Yes" ; } else { row [ 8 ] = "No" ; } model . addRow ( row ) ; } }
End of variables declaration//GEN-END:variables
End of variables declaration // GEN - END : variables
//System.out.println(p.getSerialNumber());