如何在Object[]
类变量中添加元素?我有arrayList
包含 DTO 类数据的对象(第 125 行,第 6 列)。我想显示所有数据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);
for (Object item : arrayList) {
Object[] row = new Object[6];
how to add the element in row ...?
model.addRow(row);
}
final JTable table = new JTable(model);