【正文】
()。 jtf=new JTextField(15)。 ///(你希望的 +friendNo+聊天 )。 } //給 jphy2,初始化 50好友 jphy3=new JPanel(new GridLayout(2,1))。 rs=(id)。 } conn=(url, userName, password)。 JLabel []jbls。 } public void mouseExited(MouseEvent e) { // TODO Autogenerated method stub JLabel j1=(JLabel)()。 if((u)) { try { //把創(chuàng)建好友列表的語句提前 FriendList qqList=new FriendList(())。 //創(chuàng)建選項卡窗口 //處理南部 jp1=new JPanel()。 ()。 } } } ( 3) 登陸界面 代碼: public class QqClientLogin extends JFrame implements ActionListener,MouseListener{ JLabel jbl1。 String s4=39。男 39。 (jp2_jtf4)。 jp2_jtf11=new JTextField(15)。 jp2_jl1=new JLabel(昵稱 :,)。 Connection conn=null。 } public MyServerFrame() { jp1=new JPanel()。在界面上標題欄上顯示好友 userId 的界面??蛻舳说玫阶孕畔⒑髸谇芭_填寫注冊信息,然后創(chuàng)建文件輸出流,再用《面向對象程序設計》課程設計報告 對象輸出流包裝后寫入本地文件將其持久化。好,這樣的話, 帳號的測試我們就可以進行了。局域網(wǎng)聊天程序的設計目標為一個高性能的,易于使用的,面向局域網(wǎng)的即時信息軟件。人們禁不住向往著一個全新的教育體制 — 基于 Inter/Intra 教育網(wǎng)的教育體制,在這種體制下,不受時間、空間和地域的限制,不受應用軟件的限制,通過計算機網(wǎng)絡可擴展至全社會的每一個角落,甚至是全世界,這是真正意義上的開放大學。 關鍵詞: Java, MyEclipse, 通訊 , 局域網(wǎng) ,聊天 《面向對象程序設計》課程設計報告 Abstract With the development of the Inter, people rely on work more and more, more and more inseparable from the work, the resulting chat tools, more and more. This experiment will be in accordance with the design of tencent chat tool , realize the basic function of the LAN work munication, so that the users in the case of not connected to the Inter can also municate. This article written by the your LAN chat software college is to solve in order to solve the general teachers college students surfing the Inter is difficult, charge overdraft, work speed is slow and difficult. The software mainly includes: the server response, login system, registration, friend interface, chat interface, etc. In the curriculum design, we applied the MyEclipse development tools in WINDOWS platform based on WINDOWS platform to develop a local area work (LAN) munication tools, we fully learned JAVA Swing and awt interface development technology, make oneself in the aspect of application interface and interface layout to get more practice, Socket technology is applied to implement the work connection, for the realization of the work and munications have a further understanding of multithreaded applications, making the client and the server can implement multitasking capabilities. Keywords : Java, MyEclipse, munication, Local area work, chat 《面向對象程序設計》課程設計報告 1 引言 隨著 Inter 的發(fā)展, Inter 將提供越來越多的服務?,F(xiàn)在,許多互聯(lián)網(wǎng)站點都建立了可供大眾訪問的資料庫,這些資料都可以通過網(wǎng)絡通訊獲取。作為計算機網(wǎng)絡的應用之一聊天工具,受到了用戶的普遍愛好,它把人們帶進了一個虛擬的網(wǎng)絡世界,大大的加深了人們之間的聯(lián)系。C/S 結構是本軟件系統(tǒng)的體系結構,通過它可以充分利用兩端硬件環(huán)境的優(yōu)勢,將任務合理分配到 Client 端和 Server 端來實現(xiàn),降低了系統(tǒng)的通訊開銷。同時在服務器端顯示出來。語言過濾的時候將會打開“ ”文件,不允許出現(xiàn)的關鍵詞將會存儲在文件中,關鍵字之間以逗號分割。 客戶端發(fā)送信息時,將要發(fā)送的內(nèi)容(包括聊天信息標識。 (jb2)。 JTextField jp2_jtf11,jp2_jtf12,jp2_jtf3,jp2_jtf4。 b1=()。 (jp2_jl1)。 ()。 sql=()。+b+39。 JTextField jp2_jtf。 jp2_jpf=new JPasswordField()。 《面向對象程序設計》課程設計報告 (jp1_jb2)。 ()。 } } String url = jdbc: String userName = root。 sql=()。 } } 《面向對象程序設計》課程設計報告 public FriendList(String owerId) { =owerId。 j++。 (jsp1,)。 } public void mouseExited(MouseEvent e) { // TODO Autogenerated method stub JLabel j1=(JLabel)()。 (jb)。 《面向對象程序設計》課程設計報告 (m)。 (true)。 String owerId。 (owerId)。 } conn=(url, userName, password)。 //假定 有 50 個好友 jphy2=new JPanel(new GridLayout(50,1,4,4))。 // 或者 (“ accId” )。 JScrollPane jsp1。 }else { (this,用戶名密碼錯 誤 )。 (true)。 (jp2_jbl2)。 //處理中部 jp2=new JPanel(new GridLayout(3,3))。 ()。+userId+39。 (jp1,)。 (jp2_jl4)。 (jb2)。 char b。}}} ( 2) 注冊界面 代碼 : public class register extends JFrame implements ActionListener{ static { try{ ()。 在這過程中哪怕只是一點點的錯誤,卻要花出號幾個此傲視甚至幾天的時間才把它找出來。 ( 1)用戶登錄 程序將通過 用戶登錄界面收集用戶 userId。 ( 3)能夠接收私聊信息并發(fā)送給特定的用戶。要想測試覆蓋全面