#JAVA, Add different cells of a column of a JTable

0

JAVA good, someone could guide me in a problem that I am? The question is: how can I add different cells from a column of a jTable? As shown in the Image, from the column 'Amount' I only want to add the ones that should be as shown in the Status column. the result will show it in the part where it says Debts.

    
asked by Cristopher Canales 05.06.2018 в 01:25
source

1 answer

0

what you have to do in a summation within for, and if it works please answer

double suma=0;
DefaultTableModel modelo =(DefaultTableModel) jTable1.getModel();
for (int o = 0; o < 2; o++) {
suma=suma+deuda;
   modelos.addRow(new Object[]{
      "enero"  ,
      "julio",
      deuda,
      "deber", 
     });

}
    
answered by 05.06.2018 в 01:51