我已将excel数据存储在arrayList对象中并将其发送到sendReportinTable(ArrayList list),但执行表为空。在JTable中找不到数据
String[] columnNames = {"TEST CASE NUMBER", "NO OF EXECUTION", "TOTAL NO OF PASSED", "TOTAL NO OF FAILED", "FINAL RESULT", "DATE & TIME"};
DefaultTableModel model = new DefaultTableModel(columnNames, 0);
public ReportTable() {
super(new GridLayout(1, 0));
final JTable table = new JTable(model);
table.setPreferredScrollableViewportSize(
new Dimension(1010, 500));
table.setFillsViewportHeight(
false);
JScrollPane scrollPane = new JScrollPane(table);
add(scrollPane);
}
void sendReportinTable(ArrayList list) {
for (Object item : list) {
Object[] row = new Object[6];
for (int j = 0; j < 6; j++) {
row[j] = (Object) item;
}
System.out.println("OUTPUT : -" + row);
model.addRow(row);
}
}