火车票售票系统源代码(train ticket booking system source code)

火车票售票系统源代码(train ticket booking system source code)

ID:14885396

大小:27.57 KB

页数:37页

时间:2018-07-30

火车票售票系统源代码(train ticket booking system source code)_第1页
火车票售票系统源代码(train ticket booking system source code)_第2页
火车票售票系统源代码(train ticket booking system source code)_第3页
火车票售票系统源代码(train ticket booking system source code)_第4页
火车票售票系统源代码(train ticket booking system source code)_第5页
资源描述:

《火车票售票系统源代码(train ticket booking system source code)》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库

1、火车票售票系统源代码(Trainticketbookingsystemsourcecode)importjava.awt.*;importjava.awt.event.actionevent;importjava.awt.event.actionlistener;importjava.io.*;importjavax.swing.*;importjavax.swing.border.titledborder;importjava.io.bufferedwriter;importjava.io.file;importjava.io

2、.filenotfoundexception;importjava.io.filereader;importjava.io.filewriter;importjava.io.ioexception;importjava.sql.drivermanager;importjava.sql.resultset;importjava.sql.statement;publicclasstraininformationqueryextendsjframe{privatecontainerfile.privatecomponentopen;p

3、ublictraininformationquery(){jpanelp1=newjpanel(newflowlayout(flowlayout.center));jpanelp2=newjpanel(newflowlayout(flowlayout.center));jpanelp3=newjpanel(newflowlayout(flowlayout.center));jpanelp4=newjpanel();jlabeljlb1=newjlabel("火车站列车时刻表");jlabeljlb2=newjlabel("车次"

4、);thefinaljtextfieldjtf=newjtextfield(8).jbuttonjbt1=newjbutton("查询");jbuttonjbt2=newjbutton("全部火车信息");thefinaljtextareajta=newjtextarea(10.30);p1.add(jlb1);p2.add(jta);p2.setborder(newtitledborder(""));p3.add(jlb2);p3.add(jtf);p3.add(jbt1);p3.add(jbt2);p4.add(p1,bor

5、derlayout.north);p4.add(p2,borderlayout.center);p4.add(p3,borderlayout.south);p4.setborder(newtitledborder(""));add(p4).//查询按钮thefinaljpanelpanel=newjpanel();jbt1.addactionlistener(newactionlistener(){publicvoidactionperformed(actionevent){jfilechooseropenfile=newjfi

6、lechooser();openfile.setdialogtitle("打开文件");openfile.setapprovebuttontext("打开");openfile.showopendialog(panel).filefilename=openfile.getselectedfile();stringbufferstrbf=newstringbuffer();stringerror_message="error".fileinputstreaminputfile=null;try{charbuffer[]=newch

7、ar[1024];inputfile=newfileinputstream(filename);inti=0;//如下为依次读取文件中的每一行内容,将其加入stringbuffer数据类型便利strbf中filereader=newfilereader(filename.getabsolutefile());while((len=in.read(buffer).=-1){strbf.append(buffer,0,len);}inputfile.close();//文本框对象text使用函数settext将stringbuffe

8、r的string写入文本框中jta.settext(strbf.tostring());stringopenfilename=filename.getname();settitle(openfilename);}catch(IOExceptionioex){sh

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。