资源描述:
《火车售票系统完整代码教学内容.doc》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、火车售票系统完整代码精品文档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.DriverM
2、anager;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;importj
3、avax.swing.JTextArea;importjavax.swing.JTextField;publicclassBuyPanelextendsJPanel{StringBuffersb=newStringBuffer();privatebooleanflag=false;JTextAreajtArea=newJTextArea(10,78);JLabelbuyLabel=newJLabel("订票");JTextFieldfId=newJTextField(7);JTextFieldftid=newJTextF
4、ield(7);JTextFieldfche=newJTextField(7);JTextFieldfzhangshu=newJTextField(7);JTextFieldfbodyId=newJTextField(7);JPasswordFieldjpField=newJPasswordField(7);publicJPanelgetBuypn(){JPanelpan=newJPanel();GridBagLayoutlayout=newGridBagLayout();pan.setLayout(layout);Gr
5、idBagConstraintscon=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);收集于网络,如有侵权请联系管理员删除精品
6、文档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.ad
7、d(pan);returnpan;}/***定义下面购票操作区面板pan3**@authorAdministrator**/classpan3extendsJPanel{JLabellId=newJLabel("车票号码");JLabelltid=newJLabel("车票号码");JLabelche=newJLabel("车次");JLabellbodyId=newJLabel("身份证号");JLabelpassword=newJLabel("密码");JLabellzhangshu=newJLabel("所需张数"
8、);JLabella1=newJLabel("");JLabella2=newJLabel("");JButtonsureButton=newJButton("查询确认");JButtonbuyButton=newJButton("确认购票");publicpan3(){buyButton.addActionList