ImageVerifierCode 换一换
格式:DOCX , 页数:66 ,大小:30.25KB ,
资源ID:22018574      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/22018574.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(火车售票系统完整代码Word下载.docx)为本站会员(b****8)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

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

1、); JTextField fId = new JTextField(7); JTextField ftid = new JTextField(7); JTextField fche = new JTextField(7); JTextField fzhangshu = new JTextField(7); JTextField fbodyId = new JTextField(7); JPasswordField jpField = new JPasswordField(7); public JPanel getBuypn() JPanel pan = new JPanel(); GridB

2、agLayout layout = new GridBagLayout(); pan.setLayout(layout); GridBagConstraints con = getGridBagConstraints(0, 0, 1, 1, 100, 100, GridBagConstraints.NONE, GridBagConstraints.WEST); pan.add(buyLabel, con); con = getGridBagConstraints(0, 2, 1, 1, 100, 100, pan.add(new pan3(), con); con = getGridBagCo

3、nstraints(0, 3, 1, 1, 100, 100, pan.add(new pan4(), con); con = getGridBagConstraints(0, 4, 1, 1, 100, 100, GridBagConstraints.NONE, GridBagConstraints.EAST); pan.add(new pan5(), con); this.setLocation(270, 150); this.add(pan); return pan; /* * 定义下面购票操作区面板pan3 * * author Administrator */ class pan3

4、extends JPanel JLabel lId = new JLabel( 车票号码 JLabel ltid = new JLabel( JLabel che = new JLabel( 车 次 JLabel lbodyId = new JLabel( 身份证号 JLabel password = new JLabel( 密码 JLabel lzhangshu = new JLabel( 所需张数 JLabel la1 = new JLabel( JLabel la2 = new JLabel( JButton sureButton = new JButton(查询确认 JButton b

5、uyButton = new JButton(确认购票 public pan3() buyButton.addActionListener(new ActionListener() Override public void actionPerformed(ActionEvent e) UpdateUser(); if (flag=true) UpdateTrain(); System.out.println(hjkasfhjkaf ); sureButton.addActionListener(new ActionListener() select(); GridBagLayout layou

6、t = new GridBagLayout(); this.setLayout(layout); GridBagConstraints con = getGridBagConstraints(0, 0, 1, 1, 0, 100, GridBagConstraints.NONE, GridBagConstraints.EAST); this.add(lId, con); con = getGridBagConstraints(1, 0, 1, 1, 0, 100, this.add(fId, con); con = getGridBagConstraints(8, 0, 1, 1, 0, 10

7、0, this.add(la2, con); con = getGridBagConstraints(9, 0, 1, 1, 0, 100, this.add(sureButton, con); con = getGridBagConstraints(0, 1, 1, 1, 0, 100, this.add(ltid, con); con = getGridBagConstraints(1, 1, 1, 1, 0, 100, this.add(ftid, con); con = getGridBagConstraints(2, 1, 1, 1, 0, 100, this.add(che, co

8、n); con = getGridBagConstraints(3, 1, 1, 1, 0, 100, this.add(fche, con); con = getGridBagConstraints(4, 1, 1, 1, 0, 100, this.add(lbodyId, con); con = getGridBagConstraints(5, 1, 1, 1, 0, 100, this.add(fbodyId, con); con = getGridBagConstraints(0, 2, 1, 1, 0, 100, this.add(password, con); con = getG

9、ridBagConstraints(1, 2, 1, 1, 0, 100, this.add(jpField, con); con = getGridBagConstraints(2, 2, 1, 1, 0, 100, this.add(lzhangshu, con); con = getGridBagConstraints(3, 2, 1, 1, 0, 100, this.add(fzhangshu, con); con = getGridBagConstraints(8, 2, 1, 1, 0, 100, this.add(la1, con); con = getGridBagConstr

10、aints(9, 2, 1, 1, 0, 100, this.add(buyButton, con); this.setBorder(BorderFactory.createTitledBorder(订票操作区); * 定义下面一个JList用于显示车票的所有信息面板pan4 class pan4 extends JPanel JButton btId = new JButton(车票号码 JButton bt1 = new JButton(起 点 站 JButton bt2 = new JButton(终 点 站 JButton bt3 = new JButton(车 次 JButton b

11、t4 = new JButton(发车时间 JButton bt5 = new JButton(到达时间 JButton bt6 = new JButton(座位类型 JButton bt7 = new JButton(发车日期 JButton bt8 = new JButton(剩余票数 JButton bt9 = new JButton(车票价格 public pan4() this.setLayout(new GridBagLayout(); this.add(btId, con); this.add(bt1, con); con = getGridBagConstraints(2, 0

12、, 1, 1, 0, 100, this.add(bt2, con); con = getGridBagConstraints(3, 0, 1, 1, 0, 100, this.add(bt3, con); con = getGridBagConstraints(4, 0, 1, 1, 0, 100, this.add(bt4, con); con = getGridBagConstraints(5, 0, 1, 1, 0, 100, this.add(bt5, con); con = getGridBagConstraints(6, 0, 1, 1, 0, 100, this.add(bt6

13、, con); con = getGridBagConstraints(7, 0, 1, 1, 0, 100, this.add(bt7, con); this.add(bt8, con); this.add(bt9, con); con = getGridBagConstraints(0, 1, 11, 1, 0, 100, this.add(jtArea, con); jtArea.setBackground(Color.GREEN); * 定义最下面的按钮面板pan5 class pan5 extends JPanel 退出登录 JLabel lab1 = new JLabel( pub

14、lic pan5() this.add(lab1, con); bt1.addActionListener(new ActionListener() System.exit(0); * 放回一个网格包约束 * param x * param y * param width * param heigh * param weighx * param weighy * param fill * param anchor * return private GridBagConstraints getGridBagConstraints(int x, int y, int width, int heig

15、h, int weighx, int weighy, int fill, int anchor) GridBagConstraints con = new GridBagConstraints(); con.gridx = x; con.gridy = y; con.gridwidth = width; con.gridheight = heigh; con.weightx = weighx; con.weighty = weighy; con.fill = fill; con.anchor = anchor; return con; * 按车票号码搜索所有的车票信息 * throws SQL

16、Exception private void select() Connection conn = null; Statement stmt = null; ResultSet ticket = null; try conn = DriverManager.getConnection( jdbc:oracle:thin:127.0.0.1:1521:ORCL, store catch (SQLException e1) e1.printStackTrace(); stmt = conn.createStatement(); String text = select * from train_t

17、able + where tid= + fId.getText() + ; ticket = stmt.executeQuery(text); while (ticket.next() String starter = ticket.getString(starter String reacher = ticket.getString(reacher String ticketNumber = ticket.getString(ticketNumber String startTime = ticket.getString(startTime String endTime = ticket.g

18、etString(endTime String seatIdNumber = ticket.getString(seatIdNumber String busDate = ticket.getString(busDate int ticketNum = ticket.getInt(ticketNum double price = ticket.getDouble(price sb.append( + fId.getText() + t+ + starter + + reacher + + ticketNumber + + startTime + + endTime + + seatIdNumber + + busDate + + ticketNum + + price + n jtArea.setText(sb.toString(); if (sb.length() 0) sb.delete(1, sb.length(); else JOptionPane.showMessageDialog(new TestFrame(), 无此车! catch (SQLException e) finally if (ticket != null)

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

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