2012-07-25 42 views

回答

0

我假設你的意思是在你的程序中。

int rowCount = table.getRowCount(); 
int columnCount = table.getColumnCount(); 
int row = 0; 

for (int i = 0; i < rowCount; i++) { 
    String value = table.getValueAt(i, 2); 
    if (value.equals("value2") { 
     for (int j = 0; j < columnCount; j++) { 
      value = table.getValueAt(i, j); 
      newTable.setValueAt(value, row, j): 
     } 
     row++; 
    } 
} 
相關問題