freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

本科畢業(yè)論文-基于java的多人網(wǎng)絡(luò)聊天室設(shè)計(jì)-在線瀏覽

2025-03-07 15:53本頁面
  

【正文】 送和接受信息都是要通過I/O流進(jìn)行解析和傳遞復(fù)制信息的,每個(gè)客戶端對(duì)應(yīng)一個(gè)線程進(jìn)行處理這個(gè)客戶端的所有事務(wù),客戶端對(duì)應(yīng)線程會(huì)處理服務(wù)器端傳輸過來的信息然后傳遞給用戶顯示在用戶聊天界面,所以采用了多線程技術(shù),客戶端不僅要接受服務(wù)端傳輸過來的信息,也要對(duì)服務(wù)器進(jìn)行信息反饋,所以要有一個(gè)專門的線程給服務(wù)端服務(wù)。 服務(wù)器端系統(tǒng)分析服務(wù)器端的的主要作用通過ServerSocket在服務(wù)器上建立一個(gè)服務(wù)器端口號(hào),通過Socket使用這個(gè)Socket端口號(hào)將客戶端與服務(wù)器端相連接。用戶之間的信息傳輸也是通過服務(wù)器端的中轉(zhuǎn)處理,然后通過線程和I/O流傳輸給另一個(gè)用戶,服務(wù)器端還有一個(gè)作用就是存儲(chǔ)和中轉(zhuǎn)用戶的信息和資料,通過線程獲取客戶端信息,然后從Soket那里得到用戶要傳遞和存儲(chǔ)的信息,使用I/O流進(jìn)行處理分析,最后存儲(chǔ)到文件中或傳遞給用戶。 根據(jù)流程圖我們可以得出用戶首先要通過登錄界面成功通過用戶名和用戶密碼的驗(yàn)證,就可以成功進(jìn)入聊天室進(jìn)行多人聊天和用戶私聊,如果沒有帳號(hào),則需要通過注冊(cè)將用戶信息存儲(chǔ)到服務(wù)器端,然后登錄。第4章 系統(tǒng)實(shí)現(xiàn) 客戶端界面和功能實(shí)現(xiàn) 登錄和注冊(cè)界面登錄界面登陸界面關(guān)鍵代碼public class Login { private JFrame jFrame = null。 private JLabel jLabelLoginUserName = null。 private JTextField jTextFieldLoginUserName = null。 public JButton jButtonLogin = null。 private LinkInfo linkInfo。 private OutputStream out。 public Login(LinkInfo linkInfo){ = linkInfo。 } /** * This method initializes jFrame * * return */ public void closeFrame(){ ()。 } private JFrame getJFrame() { if (jFrame == null) { jFrame = new JFrame()。 (登陸)。 (getJContentPane())。 } })。 } /** * This method initializes jContentPane * * return */ private JPanel getJContentPane() { if (jContentPane == null) { jLabelLoginPassword = new JLabel()。 (new Font(Dialog, , 14))。 jLabelLoginUserName = new JLabel()。 (new Font(Dialog, , 14))。 jContentPane = new JPanel()。 (jLabelLoginUserName, null)。 (getJTextFieldLoginUserName(), null)。 (getJButtonLogin(), null)。 } return jContentPane。 (new Rectangle(84, 56, 266, 33))。 } } })。 } /** * This method initializes jTextFieldLoginPassword * * return */ private JTextField getJTextFieldLoginPassword() { if (jTextFieldLoginPassword == null) { jTextFieldLoginPassword = new JPasswordField()。 (new () { public void keyPressed( e) { if(()==){ //當(dāng)在密碼框中按回車時(shí),調(diào)用登陸方法 doLogin()。 } return jTextFieldLoginPassword。 (new Rectangle(143, 162, 120, 41))。 (new () { public void actionPerformed( e) { //當(dāng)點(diǎn)擊了登陸按鈕時(shí),調(diào)用登陸方法 doLogin()。 } return jButtonLogin。 if(()!=null){ //做一些簡(jiǎn)單的驗(yàn)證,實(shí)際上這里應(yīng)該有比較復(fù)雜的驗(yàn)證,比如敏感字符 if(()!=nullamp。!().equals()amp。()!=nullamp。!().equals()){ if(in==null){ in = ().getInputStream()。 }// 如果獲取來自服務(wù)器端信息的線程沒有啟動(dòng),則啟動(dòng)該線程 if(gif==null){ gif = new GetServerInfo()。 } //登陸過程中,使登陸界面上的登陸按鈕不可用 (false)。 //發(fā)送登陸請(qǐng)求 (, out)。 ((), out)。 } } }catch(Exception e){ ()。 (new Rectangle(295, 214, 82, 28))。 (new () { public void actionPerformed( e) { //如果點(diǎn)擊了去注冊(cè)按鈕 //關(guān)閉登陸框 closeFrame()。 } })。 }public class Reg { private JFrame jFrame = null。 private JLabel jLabelRegUserName = null。 private JLabel jLabelRegRepassword = null。 private JPasswordField jTextFieldRegPassword = null。 public JButton jButtonReg = null。 private InputStream in。 // jve:declindex=0: private GetServerInfo gif。 public Reg(LinkInfo linkInfo){ = linkInfo。 ().setVisible(true)。 (null)。 (new Dimension(398, 337))。 (false)。 (new () { public void windowClosing( e) { (0)。 } return jFrame。 (new Rectangle(15, 162, 357, 47))。 ( 確認(rèn)密碼:)。 (new Rectangle(15, 94, 357, 47))。 ( 密 碼:)。 (new Rectangle(15, 31, 357, 47))。 ( 昵 稱:)。 (null)。 (jLabelRegPassword, null)。 (getJTextFieldRegUserName(), null)。 (getJTextFieldRegRepassword(), null)。 (getJButtonLogin(), null)。 } /** * This method initializes jTextFieldRegUserName * * return */ private JTextField getJTextFieldRegUserName() { if (jTextFieldRegUserName == null) { jTextFieldRegUserName = new JTextField()。 } return jTextFieldRegUserName。 (new Rectangle(110, 97, 258, 41))。 } /** * This method initializes jTextFieldRegRepassword * * return */ private JPasswordField getJTextFieldRegRepassword() { if (jTextFieldRegRepassword == null) { jTextFieldRegRepassword = new JPasswordField()。 } return jTextFieldRegRepassword。 (new Rectangle(146, 221, 131, 49))。 (new () { public void actionPerformed( e) { doReg()。 } return jButtonReg。 (new Rectangle(289, 266, 88, 28))。 (new () { public void actionPerformed( e) { //如果點(diǎn)擊了去登陸按鈕 //關(guān)閉注冊(cè)框 closeFrame()。 } })。 }// 注冊(cè)方法 private void doReg(){ try{ //連接服務(wù)器端 ()。amp。amp。amp。amp。amp。 }else{ if(in==null){ in = ().getInputStream()。 } //如果獲取來自服務(wù)器端信息的線程沒有啟動(dòng),則啟動(dòng)該線程 if(gif==null){ gif = new GetServerInfo()。 } //注冊(cè)過程中,使注冊(cè)界面上的注冊(cè)按鈕不可用 (false)。 (())。 ((), out)。 } }else{ ().showAlert(用戶名或密碼為空)。 } } 用戶列表界面關(guān)鍵代碼:public class TalkingMain { private JFrame jFrame = null。 private JButton jButtonFind = null。 private JTree jTree = null。//所有好友 private ArrayListTalkingMainTreeInfo allTreeNodes = new ArrayListTalkingMainTreeInfo()。 // jve:declindex=0: private String me。 } public void init(LinkInfo linkInfo){ = ()。 (this)。 (getJTree(initTree()))。 (null)。 (new Dimension(207, 441))。 (false)。 (new () { public void windowClosing( e) { (0)。 } return jFrame。 (null)。 (getJScrollPane(), null)。 } /** * This method initializes jButtonFind * * return */ private JButton getJButtonFind() { if (jButtonFind == null) { jButtonFind = new JButton()。 (進(jìn)入群聊)。 } })。 } /** * This method initializes jScrollPane * * return */ private JScrollPane getJScrollPane() { if (jScrollPane == null) { jScrollPane = new JScrollPane()。 } return jScrollPane。 //給當(dāng)前好友樹添加一個(gè)雙擊事件 (new MouseAdapter(){ public void mouseClicked(
點(diǎn)擊復(fù)制文檔內(nèi)容
電大資料相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1