空!\错误信息\
}
else if(sflight==2) {
JOptionPane.showMessageDialog(this,\你要预定的第一航班
号已经满座!\\n您可以改定同一天的航班:\\n\客户信息\TION_MESSAGE);
}
jbtflight.setText(\ else if(mflight==4)
{
JOptionPane.showMessageDialog(this,\不存在您要预定的第二航班号,请您重新查阅!\
\
错
误
信
息
\ jbtflight1.setText(\
}
else if(mflight==5)
{ JOptionPane.showMessageDialog(this,\第二航班号与第一航班号不匹配\\n请重新输入返回航班号!
}} else {
JOptionPane.showMessageDialog(null,\对不起,不能预定以前的票 }
} else { }
clientFrame.getContentPane().add(client.panel(string)); clientFrame.setTitle(\客户资料\this.setVisible(false);
JOptionPane.ERROR_MESSAGE); jbtflight1.setText(\
了\
,JOptionPane.ERROR_MESSAGE); }
24
} private boolean isTimeValid(String year,String month,String day) {
int y = Integer.parseInt(year);
int m = Integer.parseInt(month); int d = Integer.parseInt(day)
Calendar cal = Calendar.getInstance(); //得到当前时间 cal.setTime(new java.util.Date());
int py = cal.get(Calendar.YEAR);
int pm = cal.get(Calendar.MONTH) + 1;
int pd = cal.get(Calendar.DAY_OF_MONTH);
if (y == py) { if (m < pm) return false; else if(d < pd) return false;
}
return true; } public boolean timeCompare(String i,String j) { Long a=Long.parseLong(i); Long b=Long.parseLong(j); if(a>b) { return false;
}
else
return true;
}
}
25