資源簡(jiǎn)介
java課程設(shè)計(jì) 圖書(shū)查詢系統(tǒng) 內(nèi)含源代碼 打包發(fā)布

代碼片段和文件信息
/*
?*?To?change?this?template?choose?Tools?|?Templates
?*?and?open?the?template?in?the?editor.
?*/
package?client;
/**
?*
?*?@author?Administrator
?*/
import?java.net.*;
import?java.io.*;
import?java.awt.*;
import?java.awt.event.*;
import?java.applet.*;
public?class?DatabaseClient?extends?applet?implements?RunnableActionListener
{?
??TextField?輸入查詢內(nèi)容;?????????????????????????????
??Choice?choice=null;?????????????????????????????????
??Checkbox??完全一致前方一致后方一致中間包含;??????
??CheckboxGroup?group=null;
??Button?查詢;
??TextArea?顯示查詢結(jié)果;
??Label?提示條;
??Socket?socket=null;
??DataInputStream?in=null;
??DataOutputStream?out=null;
??Thread?thread;?
?public?void?init()
?{
??輸入查詢內(nèi)容=new?TextField(18);
??查詢=new?Button(“查詢“);
??choice=new?Choice();
??choice.add(“書(shū)名“);
??choice.add(“作者“);
??choice.add(“出版社“);
??choice.select(0);
??group=new?CheckboxGroup();
??完全一致=new?Checkbox(“完全一致“truegroup);
??前方一致=new?Checkbox(“前方一致“falsegroup);
??后方一致=new?Checkbox(“后方一致“falsegroup);
??中間包含=new?Checkbox(“中間包含“falsegroup);
??顯示查詢結(jié)果=new?TextArea(840);
??提示條=new?Label(“正在連接到服務(wù)器請(qǐng)稍等...“Label.CENTER);
??提示條.setForeground(Color.red);
??提示條.setFont(new?Font(“TimesRoman“Font.BOLD24));
??Panel?box1=new?Panel();?????????????????
??box1.add(new?Label(“輸入查詢內(nèi)容:“Label.CENTER));
??box1.add(輸入查詢內(nèi)容);?
??box1.add(choice);?
??box1.add(查詢);
??Panel?box2=new?Panel();????????????????
??box2.add(new?Label(“選擇查詢條件:“Label.CENTER));
??box2.add(完全一致);
??box2.add(前方一致);
??box2.add(后方一致);
??box2.add(中間包含);?
??Panel?box3=new?Panel();?????????????
??box3.add(new?Label(“查詢結(jié)果:“Label.CENTER));
??box3.add(顯示查詢結(jié)果);
??add(提示條);
??add(box1);
??add(box2);
??add(box3);?
??查詢.addActionListener(this);
?}
?public?void?start()
?{?
???if(socket!=null&&in!=null&&out!=null)
????????{??try
??????????????{
????????????????socket.close();
????????????????in.close();?
????????????????out.close();
??????????????}
??????????catch(Exception?ee)
??????????????{
??????????????}
????????}
?????try
????????{
??????????socket=new?Socket(this.getCodebase().getHost()?6666);
??????????in=new?DataInputStream(socket.getInputStream());
??????????out=new?DataOutputStream(socket.getOutputStream());
????????}
?????catch?(IOException?ee)
????????{?
??????????提示條.setText(“連接失敗“);
????????}
?????if(socket!=null)
????????{
??????????InetAddress?address=socket.getInetAddress();
??????????提示條.setText(“連接:“+address+“成功“);
????????}?
?????if(thread==null)
????????{
??????????thread=new?Thread(this);
??????????thread.start();
????????}
?}
?public?void?stop()
???{
?????try?
?????????{
???????????socket.close();
???????????thread=null;
?????????}
?????catch(IOException?e)
?????????{
??????????this.showStatus(e.toString());
?????????}
???}
?public?void?run()
?{
????String?s=null;
????while(true)
?????{?
???????try{
?????????????s=in.readUTF();
??????????}
????????catch?(IOException?e)
??????????{
????????????提示條.setText(“與服務(wù)器已斷開(kāi)“);
????????????break;
??????????}
?????顯示查詢結(jié)果.append(s);
????}
?}
?public?void?actionPerformed(ActionEvent
?屬性????????????大小?????日期????時(shí)間???名稱(chēng)
-----------?---------??----------?-----??----
?????文件?????????54??2008-12-16?21:08??圖書(shū)查詢系統(tǒng)\Client\ap
?????文件???????5011??2008-12-16?21:08??圖書(shū)查詢系統(tǒng)\Client\build\classes\client\Databa
?????文件????????698??2008-12-16?21:08??圖書(shū)查詢系統(tǒng)\Client\build\Databa
?????文件???????3355??2008-12-16?21:07??圖書(shū)查詢系統(tǒng)\Client\build.xm
?????文件???????5686??2008-12-16?21:07??圖書(shū)查詢系統(tǒng)\Client\dist\Client.jar
?????文件???????1445??2008-12-16?21:07??圖書(shū)查詢系統(tǒng)\Client\dist\README.TXT
?????文件?????????85??2008-12-16?21:07??圖書(shū)查詢系統(tǒng)\Client\manifest.mf
?????文件??????33169??2008-12-16?21:07??圖書(shū)查詢系統(tǒng)\Client\nbproject\build-impl.xm
?????文件????????455??2008-12-16?21:07??圖書(shū)查詢系統(tǒng)\Client\nbproject\genfiles.properties
?????文件?????????98??2008-12-16?21:07??圖書(shū)查詢系統(tǒng)\Client\nbproject\private\private.properties
?????文件????????211??2008-12-16?21:10??圖書(shū)查詢系統(tǒng)\Client\nbproject\private\private.xm
?????文件???????1852??2008-12-16?21:08??圖書(shū)查詢系統(tǒng)\Client\nbproject\project.properties
?????文件????????576??2008-12-16?21:07??圖書(shū)查詢系統(tǒng)\Client\nbproject\project.xm
?????文件???????4019??2008-12-16?21:07??圖書(shū)查詢系統(tǒng)\Client\src\client\Databa
?????文件????????984??2008-12-16?21:09??圖書(shū)查詢系統(tǒng)\Server\build\classes\server\Databa
?????文件???????4030??2008-12-16?21:09??圖書(shū)查詢系統(tǒng)\Server\build\classes\server\Server_thread.class
?????文件???????3355??2008-12-16?21:09??圖書(shū)查詢系統(tǒng)\Server\build.xm
?????文件???????1445??2008-12-16?21:09??圖書(shū)查詢系統(tǒng)\Server\dist\README.TXT
?????文件???????5817??2008-12-16?21:09??圖書(shū)查詢系統(tǒng)\Server\dist\Server.jar
?????文件?????????85??2008-12-16?21:09??圖書(shū)查詢系統(tǒng)\Server\manifest.mf
?????文件??????33169??2008-12-16?21:09??圖書(shū)查詢系統(tǒng)\Server\nbproject\build-impl.xm
?????文件????????455??2008-12-16?21:09??圖書(shū)查詢系統(tǒng)\Server\nbproject\genfiles.properties
?????文件?????????98??2008-12-16?21:09??圖書(shū)查詢系統(tǒng)\Server\nbproject\private\private.properties
?????文件????????211??2008-12-16?21:10??圖書(shū)查詢系統(tǒng)\Server\nbproject\private\private.xm
?????文件???????1816??2008-12-16?21:09??圖書(shū)查詢系統(tǒng)\Server\nbproject\project.properties
?????文件????????576??2008-12-16?21:09??圖書(shū)查詢系統(tǒng)\Server\nbproject\project.xm
?????文件???????4434??2008-12-16?21:09??圖書(shū)查詢系統(tǒng)\Server\src\server\Databa
?????目錄??????????0??2008-12-16?21:08??圖書(shū)查詢系統(tǒng)\Client\build\classes\client
?????目錄??????????0??2008-12-16?21:09??圖書(shū)查詢系統(tǒng)\Server\build\classes\server
?????目錄??????????0??2008-12-16?21:07??圖書(shū)查詢系統(tǒng)\Client\build\classes
............此處省略21個(gè)文件信息
評(píng)論
共有 條評(píng)論