public void displayTest(){
PC_Table table = new PC_Table("Available tests", 0, "Date, Test Number, Year Group", "Back");
table.choice();
int row = 0;
testFile.resetSerialAccess();
while (testFile.moreSerialRecords()){
if(test.date.equals(date)){// or whatever you are looking for
table.addRow();
table.setValueAt(test.date, row, 0);
table.setValueAt(test.testNo, row, 1);
table.setValueAt(test.yearGroup, row, 2);
row++;
}
if(row>0){
table.choice();
}else
JOptionPane.showMessageDialog(null, "No Tests Available");
}
}
这显示可用的测试,但它不起作用,因为表中没有显示测试信息。我不知道如何在eclipse中的表格上显示信息。有什么建议吗?