基于java航空售票系统
//退票输入框
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_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);
panel.add(button_cancel);
button_cancel.addActionListener(this);
text_user=new JTextArea();
this.add(text_user,BorderLayout.CENTER);
frame_cx=new JFrame("输入");
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);
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_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_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_tp.add(button_ok3);
button_ok3.addActionListener(this);
frame_tp.addWindowListener(this);
dialog_cx=new JDialog(this,"提示",true);
//提示查询输入航线未开通错误
dialog_cx.setSize(240,80);
public FlightBook()
//构造函数
{
super("航空订票");
this.setSize(600,400);
this.setLocation(300,240);
this.setResizable(false);
this.setVisible(true);
this.setLayout(new BorderLayout());
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_cx.setSize(280,120);
frame_cx.setResizable(false);
frame_cx.setBackground(Color.LIGHT_GRAY);
frame_cx.setLayout(new FlowLayout());
frame_cx.add(new JLabel("终点站:"));
button_ask.addActionListener(this);
button_book=new JButton("订票");
panel.add(button_book);
button_book.addActionListener(this);
button_cancel=new JButton("退票");
text_field4=new JTextField(eld4);
frame_tp.add(new JLabel("航班号:"));
text_field5=new JTextField(20);
frame_tp.add(text_field5);
button_ok3=new JButton("正确");
frame_dp=new JFrame("输入");
//订票输入框
frame_dp.setSize(350,150);
frame_dp.setResizable(false);
frame_dp.setBackground(Color.LIGHT_GRAY);
frame_dp.setLayout(new FlowLayout());