publicFlightBook()//构造函数{super(航空订票);this.setSize(600,400);this.setLocation(300,240);this.setResizable(false);this.setVisible(true);this.setLayout(newBorderLayout());JPanelpanel=newJPanel(newGridLayout(11,1));this.add(panel,BorderLayout.WEST);this.setBackground(Color.blue);button_ask=newJButton(查询);panel.add(button_ask);button_ask.addActionListener(this);button_book=newJButton(订票);panel.add(button_book);button_book.addActionListener(this);button_cancel=newJButton(退票);panel.add(button_cancel);button_cancel.addActionListener(this);text_user=newJTextArea();this.add(text_user,BorderLayout.CENTER);frame_cx=newJFrame(输入);//查询输入框frame_cx.setSize(280,120);frame_cx.setResizable(false);frame_cx.setBackground(Color.LIGHT_GRAY);frame_cx.setLayout(newFlowLayout());frame_cx.add(newJLabel(终点站:));text_field1=newJTextField(20);frame_cx.add(text_field1);button_ok1=newJButton(ok);frame_cx.add(button_ok1);button_ok1.addActionListener(this);frame_cx.addWindowListener(this);frame_dp=newJFrame(输入);//订票输入框frame_dp.setSize(350,150);frame_dp.setResizable(false);frame_dp.setBackground(Color.LIGHT_GRAY);frame_dp.setLayout(newFlowLayout());frame_dp.add(newJLabel(航班号:));text_field2=newJTextField(20);frame_dp.add(text_field2);frame_dp.add(newJLabel(订票数:));text_field3=newJTextField(20);frame_dp.add(text_field3);button_ok2=newJButton(确定);frame_dp.add(button_ok2);button_ok2.addActionListener(this);frame_dp.addWindowListener(this);frame_tp=newJFrame(输入);//退票输入框frame_tp.setSize(350,150);frame_tp.setResizable(false);frame_tp.setBackground(Color.LIGHT_GRAY);frame_tp.setLayout(newFlowLayout());frame_tp.add(newJLabel(日期:));text_field4=newJTextField(20);frame_tp.add(text_field4);frame_tp.add(newJLabel(航班号:));text_field5=newJTextField(20);frame_tp.add(text_field5);button_ok3=newJButton(正确);frame_tp.add(button_ok3);button_ok3.addActionListener(this);frame_tp.addWindowListener(this);dialog_cx=newJDialog(this,提示,true);//提示查询输入航线未开通错误dialog_cx.setSize(240,80);label=newJLabel(此站点未开通航线,请重新输入!);dialog_cx.add(label);dialog_cx.setLayout(newFlowLayout(FlowLayout.CENTER));dialog_cx.addWindowListener(this);frame_dpsx=newJFrame(订票手续);//订票手续frame_dpsx.setSize(250,200);frame_dpsx.setResizable(false);frame_dpsx.setBackground(Color.LIGHT_GRAY);frame_dpsx.setLayout(newFlowLayout(FlowLayout.CENTER));frame_dpsx.add(newJLabel(姓名:));text_fielddp_name=newJTextField(10);frame_dpsx.add(text_fielddp_name);frame_dpsx.add(newJLabel(航班号:));text_fielddp_hbh=newJTextField(10);frame_dpsx.add(text_fielddp_hbh);frame_dpsx.add(newJLabel(订票数:));text_fielddp_number=newJTextField(10);frame_dpsx.add(text_fielddp_number);frame_dpsx.add(newJLabel(联系方式:));text_fielddp_lxfs=newJTextField(10);frame_dpsx.add(text_fielddp_lxfs);button_tj=newJButton(提交);frame_dpsx.add(button_tj);button_tj.addActionListener(this);frame_djsx=newJFrame(登记手续);//登记手续frame_djsx.setSize(250,200);frame_djsx.setResizable(false);frame_djsx.setBackground(Color.LIGHT_GRAY);frame_djsx.setLayout(newFlowLayout(FlowLayout.CENTER));frame_djsx.add(newJLabel(姓名:));text_fielddj_name=newJTextField(10);frame_djsx.add(text_fielddj_name);frame_djsx.add(newJLabel(航班号:));text_fielddj_hbh=newJTextField(10);frame_djsx.add(text_fielddj_hbh);frame_djsx.add(newJLabel(订票数:));text_fielddj_number=newJTextField(10);frame_djsx.add(text_fielddj_number);frame_djsx.add(newJLabel(联系方式:));text_fielddj_lxfs=newJTextField(10);frame_djsx.add(text_fielddj_lxfs);button_wc=newJButton(完成);frame_djsx.add(button_wc);button_wc.addActionListener(this);frame_tpsx=newJFrame(退票手续);//退票手续frame_tpsx.setSize(250,200);frame_tpsx.setResizable(false);frame_tpsx.setBackground(Color.LIGHT_GRAY);frame_tpsx.setLayout(newFlowLayout(FlowLayout.CENTER));frame_tpsx.add(newJLabel(姓名:));text_fieldtp_name=newJTextField(10);frame_tpsx.add(text_fieldtp_name);frame_tpsx.add(newJLabel(航班号:));text_fieldtp_hbh=newJTextField(10);frame_tpsx.add(text_fieldtp_hbh);frame_tpsx.add(newJLabel(退票数:));text_fieldtp_number=newJTextField(10);frame_tpsx.add(text_fieldtp_number);frame_tpsx.add(newJLabel(联系方式:));text_fieldtp_lxfs=newJTextField(10);frame_tpsx.add(text_fieldtp_lxfs);button_cg=newJButton(成功);frame_tpsx.add(button_cg);button_cg.addActionListener(this);dialog_dpwk=newJDialog(this,提示,true);//提示订票输入未开通航线错误dialog_dpwk.setSize(350,80);label=newJLabel(此站点未开通航线,请查询后重新输入!);dialog_dpwk.add(label);dialog_dpwk.setLayout(newFlowLayout(FlowLayout.CENTER));dialog_dpwk.addWindowListener(this);dialog_dpyk=newJDialog(this,提示,true);//提示订票输入票额不足错误dialog_dpyk.setSize(350,150);label1=newJLabel(此站点已满员或余票不足,请查询后重新输入!);dialog_dpyk.add(label1);label2=newJLabel(若需要,可登记排队候补);dialog_dpyk.add(label2);button_sq=newJButton(登记);button_sq.addActionListener(this);dialog_dpyk.add(button_sq);dialog_dpyk.setLayout(newFlowLayout(FlowLayout.CENTER));dialog_dpyk.addWindowListener(this);dialog_tpts=newJDialog(this,提示,true);//提示退票输入日期和航班号矛盾错误dialog_tpts.setSize(350,80);label=newJLabel(您输入的日期无此航班号,请查询后重新输入!);dialog_tpts.add(label);dialog_tpts.setLayout(newFlowLayout(FlowLayout.CENTER));dialog_tpts.addWindowListener(this);d=newJDialo