基于java航空售票系统.docx
- 文档编号:987981
- 上传时间:2022-10-15
- 格式:DOCX
- 页数:19
- 大小:71.85KB
基于java航空售票系统.docx
《基于java航空售票系统.docx》由会员分享,可在线阅读,更多相关《基于java航空售票系统.docx(19页珍藏版)》请在冰豆网上搜索。
基于java航空售票系统
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
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 基于 java 航空 售票 系统
![提示](https://static.bdocx.com/images/bang_tan.gif)