火车售票系统完整代码.docx

上传人:b****2 文档编号:2328333 上传时间:2022-10-28 格式:DOCX 页数:55 大小:29.84KB
下载 相关 举报
火车售票系统完整代码.docx_第1页
第1页 / 共55页
火车售票系统完整代码.docx_第2页
第2页 / 共55页
火车售票系统完整代码.docx_第3页
第3页 / 共55页
火车售票系统完整代码.docx_第4页
第4页 / 共55页
火车售票系统完整代码.docx_第5页
第5页 / 共55页
点击查看更多>>
下载资源
资源描述

火车售票系统完整代码.docx

《火车售票系统完整代码.docx》由会员分享,可在线阅读,更多相关《火车售票系统完整代码.docx(55页珍藏版)》请在冰豆网上搜索。

火车售票系统完整代码.docx

火车售票系统完整代码

packagecom.yue;

importjava.awt.Color;

importjava.awt.GridBagConstraints;

importjava.awt.GridBagLayout;

importjava.awt.event.ActionEvent;

importjava.awt.event.ActionListener;

importjava.sql.CallableStatement;

importjava.sql.Connection;

importjava.sql.DriverManager;

importjava.sql.ResultSet;

importjava.sql.SQLException;

importjava.sql.Statement;

importjavax.swing.BorderFactory;

importjavax.swing.JButton;

importjavax.swing.JLabel;

importjavax.swing.JOptionPane;

importjavax.swing.JPanel;

importjavax.swing.JPasswordField;

importjavax.swing.JTextArea;

importjavax.swing.JTextField;

publicclassBuyPanelextendsJPanel{

StringBuffersb=newStringBuffer();

privatebooleanflag=false;

JTextAreajtArea=newJTextArea(10,78);

JLabelbuyLabel=newJLabel("订票");

JTextFieldfId=newJTextField(7);

JTextFieldftid=newJTextField(7);

JTextFieldfche=newJTextField(7);

JTextFieldfzhangshu=newJTextField(7);

JTextFieldfbodyId=newJTextField(7);

JPasswordFieldjpField=newJPasswordField(7);

publicJPanelgetBuypn(){

JPanelpan=newJPanel();

GridBagLayoutlayout=newGridBagLayout();

pan.setLayout(layout);

GridBagConstraintscon=getGridBagConstraints(0,0,1,1,100,100,

GridBagConstraints.NONE,GridBagConstraints.WEST);

pan.add(buyLabel,con);

con=getGridBagConstraints(0,2,1,1,100,100,

GridBagConstraints.NONE,GridBagConstraints.WEST);

pan.add(newpan3(),con);

con=getGridBagConstraints(0,3,1,1,100,100,

GridBagConstraints.NONE,GridBagConstraints.WEST);

pan.add(newpan4(),con);

con=getGridBagConstraints(0,4,1,1,100,100,

GridBagConstraints.NONE,GridBagConstraints.EAST);

pan.add(newpan5(),con);

this.setLocation(270,150);

this.add(pan);

returnpan;

}

/**

*定义下面购票操作区面板pan3

*

*@authorAdministrator

*

*/

classpan3extendsJPanel{

JLabellId=newJLabel("车票号码");

JLabelltid=newJLabel("车票号码");

JLabelche=newJLabel("车次");

JLabellbodyId=newJLabel("身份证号");

JLabelpassword=newJLabel("密码");

JLabellzhangshu=newJLabel("所需张数");

JLabella1=newJLabel("");

JLabella2=newJLabel("");

JButtonsureButton=newJButton("查询确认");

JButtonbuyButton=newJButton("确认购票");

publicpan3(){

buyButton.addActionListener(newActionListener(){

@Override

publicvoidactionPerformed(ActionEvente){

UpdateUser();

if(flag==true){

UpdateTrain();

System.out.println("hjkasfhjkaf");

}

}

});

sureButton.addActionListener(newActionListener(){

@Override

publicvoidactionPerformed(ActionEvente){

select();

}

});

GridBagLayoutlayout=newGridBagLayout();

this.setLayout(layout);

GridBagConstraintscon=getGridBagConstraints(0,0,1,1,0,100,

GridBagConstraints.NONE,GridBagConstraints.EAST);

this.add(lId,con);

con=getGridBagConstraints(1,0,1,1,0,100,

GridBagConstraints.NONE,GridBagConstraints.EAST);

this.add(fId,con);

con=getGridBagConstraints(8,0,1,1,0,100,

GridBagConstraints.NONE,GridBagConstraints.EAST);

this.add(la2,con);

con=getGridBagConstraints(9,0,1,1,0,100,

GridBagConstraints.NONE,GridBagConstraints.EAST);

this.add(sureButton,con);

con=getGridBagConstraints(0,1,1,1,0,100,

GridBagConstraints.NONE,GridBagConstraints.EAST);

this.add(ltid,con);

con=getGridBagConstraints(1,1,1,1,0,100,

GridBagConstraints.NONE,GridBagConstraints.EAST);

this.add(ftid,con);

con=getGridBagConstraints(2,1,1,1,0,100,

GridBagConstraints.NONE,GridBagConstraints.EAST);

this.add(che,con);

con=getGridBagConstraints(3,1,1,1,0,100,

GridBagConstraints.NONE,GridBagConstraints.EAST);

this.add(fche,con);

con=getGridBagConstraints(4,1,1,1,0,100,

GridBagConstraints.NONE,GridBagConstraints.EAST);

this.add(lbodyId,con);

con=getGridBagConstraints(5,1,1,1,0,100,

GridBagConstraints.NONE,GridBagConstraints.EAST);

this.add(fbodyId,con);

con=getGridBagConstraints(0,2,1,1,0,100,

GridBagConstraints.NONE,GridBagConstraints.EAST);

this.add(password,con);

con=getGridBagConstraints(1,2,1,1,0,100,

GridBagConstraints.NONE,GridBagConstraints.EAST);

this.add(jpField,con);

con=getGridBagConstraints(2,2,1,1,0,100,

GridBagConstraints.NONE,GridBagConstraints.EAST);

this.add(lzhangshu,con);

con=getGridBagConstraints(3,2,1,1,0,100,

GridBagConstraints.NONE,GridBagConstraints.EAST);

this.add(fzhangshu,con);

con=getGridBagConstraints(8,2,1,1,0,100,

GridBagConstraints.NONE,GridBagConstraints.EAST);

this.add(la1,con);

con=getGridBagConstraints(9,2,1,1,0,100,

GridBagConstraints.NONE,GridBagConstraints.EAST);

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 人文社科 > 法律资料

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1