




已阅读5页,还剩17页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
。public FlightBook() /构造函数super(航空订票);this.setSize(600,400);this.setLocation(300,240);this.setResizable(false); this.setVisible(true);this.setLayout(new BorderLayout();JPanel panel=new JPanel(new GridLayout(11,1);this.add(panel,BorderLayout.WEST);this.setBackground(Color.blue);button_ask=new JButton(查询);panel.add(button_ask);button_ask.addActionListener(this);button_book=new JButton(订票);panel.add(button_book);button_book.addActionListener(this);button_cancel=new JButton(退票);panel.add(button_cancel);button_cancel.addActionListener(this);text_user=new JTextArea();this.add(text_user,BorderLayout.CENTER);frame_cx=new JFrame(输入); /查询输入框frame_cx.setSize(280,120);frame_cx.setResizable(false);frame_cx.setBackground(Color.LIGHT_GRAY);frame_cx.setLayout(new FlowLayout();frame_cx.add(new JLabel(终点站:);text_field1=new JTextField(20);frame_cx.add(text_field1);button_ok1=new JButton(ok);frame_cx.add(button_ok1);button_ok1.addActionListener(this);frame_cx.addWindowListener(this);frame_dp=new JFrame(输入); /订票输入框frame_dp.setSize(350,150);frame_dp.setResizable(false);frame_dp.setBackground(Color.LIGHT_GRAY);frame_dp.setLayout(new FlowLayout();frame_dp.add(new JLabel( 航班号:);text_field2=new JTextField(20);frame_dp.add(text_field2);frame_dp.add(new JLabel( 订票数:);text_field3=new JTextField(20);frame_dp.add(text_field3);button_ok2=new JButton(确定);frame_dp.add(button_ok2);button_ok2.addActionListener(this);frame_dp.addWindowListener(this);frame_tp=new JFrame(输入); /退票输入框frame_tp.setSize(350,150);frame_tp.setResizable(false);frame_tp.setBackground(Color.LIGHT_GRAY);frame_tp.setLayout(new FlowLayout();frame_tp.add(new JLabel( 日期 :);text_field4=new JTextField(20);frame_tp.add(text_field4);frame_tp.add(new JLabel( 航班号:);text_field5=new JTextField(20);frame_tp.add(text_field5);button_ok3=new JButton(正确);frame_tp.add(button_ok3);button_ok3.addActionListener(this);frame_tp.addWindowListener(this);dialog_cx=new JDialog(this,提示,true); /提示查询输入航线未开通错误dialog_cx.setSize(240,80);label=new JLabel(此站点未开通航线,请重新输入!);dialog_cx.add(label);dialog_cx.setLayout(new FlowLayout(FlowLayout.CENTER);dialog_cx.addWindowListener(this); frame_dpsx=new JFrame(订票手续); /订票手续frame_dpsx.setSize(250,200);frame_dpsx.setResizable(false);frame_dpsx.setBackground(Color.LIGHT_GRAY);frame_dpsx.setLayout(new FlowLayout(FlowLayout.CENTER);frame_dpsx.add(new JLabel( 姓名 :);text_fielddp_name=new JTextField(10);frame_dpsx.add(text_fielddp_name);frame_dpsx.add(new JLabel( 航班号 :);text_fielddp_hbh=new JTextField(10);frame_dpsx.add(text_fielddp_hbh);frame_dpsx.add(new JLabel( 订票数 :);text_fielddp_number=new JTextField(10);frame_dpsx.add(text_fielddp_number);frame_dpsx.add(new JLabel(联系方式 :);text_fielddp_lxfs=new JTextField(10);frame_dpsx.add(text_fielddp_lxfs);button_tj=new JButton(提交);frame_dpsx.add(button_tj);button_tj.addActionListener(this);frame_djsx=new JFrame(登记手续); /登记手续frame_djsx.setSize(250,200);frame_djsx.setResizable(false);frame_djsx.setBackground(Color.LIGHT_GRAY);frame_djsx.setLayout(new FlowLayout(FlowLayout.CENTER);frame_djsx.add(new JLabel( 姓名 :);text_fielddj_name=new JTextField(10);frame_djsx.add(text_fielddj_name);frame_djsx.add(new JLabel( 航班号 :);text_fielddj_hbh=new JTextField(10);frame_djsx.add(text_fielddj_hbh);frame_djsx.add(new JLabel( 订票数 :);text_fielddj_number=new JTextField(10);frame_djsx.add(text_fielddj_number);frame_djsx.add(new JLabel(联系方式 :);text_fielddj_lxfs=new JTextField(10);frame_djsx.add(text_fielddj_lxfs);button_wc=new JButton(完成);frame_djsx.add(button_wc);button_wc.addActionListener(this);frame_tpsx=new JFrame(退票手续); /退票手续frame_tpsx.setSize(250,200);frame_tpsx.setResizable(false);frame_tpsx.setBackground(Color.LIGHT_GRAY);frame_tpsx.setLayout(new FlowLayout(FlowLayout.CENTER);frame_tpsx.add(new JLabel( 姓名 :);text_fieldtp_name=new JTextField(10);frame_tpsx.add(text_fieldtp_name);frame_tpsx.add(new JLabel( 航班号 :);text_fieldtp_hbh=new JTextField(10);frame_tpsx.add(text_fieldtp_hbh);frame_tpsx.add(new JLabel( 退票数 :);text_fieldtp_number=new JTextField(10);frame_tpsx.add(text_fieldtp_number);frame_tpsx.add(new JLabel(联系方式 :);text_fieldtp_lxfs=new JTextField(10);frame_tpsx.add(text_fieldtp_lxfs);button_cg=new JButton(成功);frame_tpsx.add(button_cg);button_cg.addActionListener(this);dialog_dpwk=new JDialog(this,提示,true); /提示订票输入未开通航线错误dialog_dpwk.setSize(350,80);label=new JLabel(此站点未开通航线,请查询后重新输入!);dialog_dpwk.add(label);dialog_dpwk.setLayout(new FlowLayout(FlowLayout.CENTER);dialog_dpwk.addWindowListener(this);dialog_dpyk=new JDialog(this,提示,true); /提示订票输入票额不足错误dialog_dpyk.setSize(350,150);label1=new JLabel(此站点已满员或余票不足,请查询后重新输入!);dialog_dpyk.add(label1);label2=new JLabel( 若需要,可登记排队候补);dialog_dpyk.add(label2);button_sq=new JButton(登记);button_sq.addActionListener(this);dialog_dpyk.add(button_sq);dialog_dpyk.setLayout(new FlowLayout(FlowLayout.CENTER);dialog_dpyk.addWindowListener(this);dialog_tpts=new JDialog(this,提示,true); /提示退票输入日期和航班号矛盾错误dialog_tpts.setSize(350,80);label=new JLabel(您输入的日期无此航班号,请查询后重新输入!);dialog_tpts.add(label);dialog_tpts.setLayout(new FlowLayout(FlowLayout.CENTER);dialog_tpts.addWindowListener(this);d=new JDialog(this,提示,true); /当退票满足客户,提示联系该客户d.setSize(350,150);d.setLayout(new FlowLayout(FlowLayout.CENTER);d.addWindowListener(this);this.addWindowListener(this);this.setVisible(true);4.1.2 软件的查询、订票和退票模块查询截图:查询成功截图:订票截图:退票截图:代码:public void actionPerformed(ActionEvent e) String s=e.getActionCommand(); if(s=查询) frame_cx.setLocation(this.getX()+100,this.getY()+100); frame_cx.setVisible(true); if(s=订票) frame_dp.setLocation(this.getX()+100,this.getY()+100); frame_dp.setVisible(true); if(s=退票) frame_tp.setLocation(this.getX()+100,this.getY()+100); frame_tp.setVisible(true); if(s=ok) if(text_field1.getText().toString().trim().equals(北京) text_user.append(地点:+F_name0+ 航班号:+H_number0+ 飞机号:+F_number0+ 时间:+time0+ 价格:+Price0+ 余票量:+Count0+n); else if(text_field1.getText().toString().trim().equals(香港) text_user.append(地点:+F_name1+ 航班号:+H_number1+ 飞机号:+F_number1+ 时间:+time1+ 价格:+Price1+ 余票量:+Count1+n); else if(text_field1.getText().toString().trim().equals(澳门) text_user.append(地点:+F_name2+ 航班号:+H_number2+ 飞机号:+F_number2+ 时间:+time2+ 价格:+Price2+ 余票量:+Count2+n); else if(text_field1.getText().toString().trim().equals(纽约) text_user.append(地点:+F_name3+ 航班号:+H_number3+ 飞机号:+F_number3+ 时间:+time3+ 价格:+Price3+ 余票量:+Count3+n); else if(text_field1.getText().toString().trim().equals(悉尼) text_user.append(地点:+F_name4+ 航班号:+H_number4+ 飞机号:+F_number4+ 时间:+time4+ 价格:+Price4+ 余票量:+Count4+n); else dialog_cx.setLocation(this.getX()+100,this.getY()+100); dialog_cx.setVisible(true); frame_cx.setVisible(false); if(s=确定) String Hnumber=text_field2.getText().toString().trim(); int Dcount=Integer.parseInt(text_field3.getText().toString().trim(); if(Hnumber.equals(CAC)|Hnumber.equals(cac) if(Dcount=Count0) Count0-=Dcount; frame_dpsx.setLocation(this.getX()+100,this.getY()+100); frame_dpsx.setVisible(true); else dialog_dpyk.setLocation(this.getX()+100,this.getY()+100); dialog_dpyk.setVisible(true); else if(Hnumber.equals(CFC)|Hnumber.equals(cfc)&Dcount=Count1) if(Dcount=Count1) Count0-=Dcount; frame_dpsx.setLocation(this.getX()+100,this.getY()+100); frame_dpsx.setVisible(true); else dialog_dpyk.setLocation(this.getX()+100,this.getY()+100); dialog_dpyk.setVisible(true); else if(Hnumber.equals(CDA)|Hnumber.equals(cda)&Dcount=Count2) if(Dcount=Count2) Count0-=Dcount; frame_dpsx.setLocation(this.getX()+100,this.getY()+100); frame_dpsx.setVisible(true); else dialog_dpyk.setLocation(this.getX()+100,this.getY()+100); dialog_dpyk.setVisible(true); else if(Hnumber.equals(CCX)|Hnumber.equals(ccx)&Dcount=Count3) if(Dcount=Count3) Count0-=Dcount; frame_dpsx.setLocation(this.g
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025秋开学全体教师大会,分管安全副校长讲话:以安全为纲,以德育为翼,共筑新学期校园安全与育人新征程
- 2025年高级技师题库及答案
- 2025年高级保安员模拟试题及参考答案
- 高级收纳师题库及答案
- 政务员礼仪考试题及答案
- 电工复审新试题及答案
- 装备服务保障管理办法
- 西藏土豆存货管理办法
- 老土地登记管理办法
- 产品报废销毁管理办法
- CJ/T 249-2007城镇污水处理厂污泥处置混合填埋泥质
- T/CACEM 22.3-2022校车运营服务管理第3部分:驾驶员与随车照管员管理规范
- 2025年版简易房屋租赁合同模板
- 儿童商业插画课件图片
- 医疗机构从业人员行为规范培训
- 智能医疗中的知识图谱与多模态数据融合研究-洞察阐释
- 厨师岗位安全协议书
- 公路建设副总岗位职责与要求
- 《绿色建筑施工培训课件》资料
- 2025年行测真题及答案详解
- 黄委会面试真题及答案
评论
0/150
提交评论