我是Java的新手,在满足条件tempTable.size() == 1
时会有以下代码,然后会弹出消息框,但它不起作用,代码停在System.out.println("Print Message No search result");
行。任何人都可以帮助我为什么消息框没有弹出?
public boolean Report()throws DocumentException, IOException {
Document document = new Document(PageSize.A4, LEFT_MARGIN, RIGHT_MARGIN, TOP_MARGIN, BOTTOM_MARGIN);
PdfPTable tempTable = constructTable();
System.out.println("Document size is " + tempTable.size());
if (tempTable.size() == 1) {
try {
System.out.println("Print Message No search result");
JOptionPane.showMessageDialog(null, "No Search Result");
System.out.println("Finish Print Message No search result");
} catch (Exception e){
e.printStackTrace();
System.out.println("throw exception on try show msgbox: ");
}
}else{...}