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

正文內容

本科畢業(yè)論文-基于java的多人網絡聊天室設計-文庫吧資料

2025-01-24 15:53本頁面
  

【正文】 Pane())。 (Talking)。 } private JFrame getJFrame() { if (jFrame == null) { jFrame = new JFrame()。 } /** * This method initializes jFrame * * return */ public void closeFrame(){ ()。 } public void showAllFriend(ArrayListString allFriends){ = allFriends。 = linkInfo。 // jve:declindex=0: public TalkingMain(){ ().setVisible(true)。//所有好友對應樹節(jié)點 private LinkInfo linkInfo。 private ArrayListString allFriends。 private JScrollPane jScrollPane = null。 // jve:declindex=0:visualconstraint=357,12 private JPanel jContentPane = null。 } } }catch(Exception e){ ()。 ((), out)。 (, out)。// 注冊過程中,使注冊界面上的去登陸按鈕不可用 (false)。 new Thread(gif).start()。 } if(out==null){ out = ().getOutputStream()。!().equals()){ if(!().equals(())){ ().showAlert(兩次密碼輸入不一致)。()!=nullamp。!().equals()amp。()!=nullamp。!().equals()amp。 if(()!=null){ //做一些簡單的驗證,實際上這里應該有比較復雜的驗證,比如敏感字符 if(()!=nullamp。 } return jButtonLogin。 //打開登陸框 (new Login(linkInfo))。 (去登陸)。 } /** * This method initializes jButtonLogin * * return */ private JButton getJButtonLogin() { if (jButtonLogin == null) { jButtonLogin = new JButton()。 } })。 (注冊)。 } /** * This method initializes jButtonReg * * return */ private JButton getJButtonReg() { if (jButtonReg == null) { jButtonReg = new JButton()。 (new Rectangle(111, 165, 258, 41))。 } return jTextFieldRegPassword。 } /** * This method initializes jTextFieldRegPassword * * return */ private JPasswordField getJTextFieldRegPassword() { if (jTextFieldRegPassword == null) { jTextFieldRegPassword = new JPasswordField()。 (new Rectangle(110, 34, 258, 41))。 } return jContentPane。 (getJButtonReg(), null)。 (getJTextFieldRegPassword(), null)。 (jLabelRegRepassword, null)。 (jLabelRegUserName, null)。 jContentPane = new JPanel()。 (new Font(Dialog, , 18))。 jLabelRegUserName = new JLabel()。 (new Font(Dialog, , 18))。 jLabelRegPassword = new JLabel()。 (new Font(Dialog, , 18))。 } /** * This method initializes jContentPane * * return */ private JPanel getJContentPane() { if (jContentPane == null) { jLabelRegRepassword = new JLabel()。 } })。 (getJContentPane())。 (注冊)。 } /** * This method initializes jFrame * * return */ private JFrame getJFrame() { if (jFrame == null) { jFrame = new JFrame()。 } public void closeFrame(){ ()。 (this)。 private LinkInfo linkInfo。 private OutputStream out。 public JButton jButtonLogin = null。 private JPasswordField jTextFieldRegRepassword = null。 private JTextField jTextFieldRegUserName = null。 private JLabel jLabelRegPassword = null。 // jve:declindex=0:visualconstraint=241,22 private JPanel jContentPane = null。 } return jButtonReg。 //顯示注冊框 (new Reg(linkInfo))。 (去注冊)。 } }注冊界面關鍵代碼/** * This method initializes jButtonReg * * return */ private JButton getJButtonReg() { if (jButtonReg == null) { jButtonReg = new JButton()。 }else{ ().showAlert(用戶名或密碼為空)。 ((), out)。 //設置LinkInfo中自己的信息 (())。 new Thread(gif).start()。 } if(out==null){ out = ().getOutputStream()。amp。amp。amp。 } //登陸方法 private void doLogin(){ try{ //連接服務器端 ()。 } })。 (登陸)。 } /** * This method initializes jButtonLogin * * return */ private JButton getJButtonLogin() { if (jButtonLogin == null) { jButtonLogin = new JButton()。 } } })。 (new Rectangle(84, 111, 266, 33))。 } return jTextFieldLoginUserName。 (new () { public void keyPressed( e) { if(()==){ //當在用戶名框中按回車時,調用登陸方法 doLogin()。 } /** * This method initializes jTextFieldLoginUserName * * return */ private JTextField getJTextFieldLoginUserName() { if (jTextFieldLoginUserName == null) { jTextFieldLoginUserName = new JTextField()。 (getJButtonReg(), null)。 (getJTextFieldLoginPassword(), null)。 (jLabelLoginPassword, null)。 (null)。 ( Talk號:)。 (new Rectangle(18, 53, 335, 38))。 ( 密 碼:)。 (new Rectangle(18, 107, 335, 38))。 } return jFrame。 (new () { public void windowClosing( e) { (0)。 (false)。 (new Dimension(389, 274))。 (null)。 ().setVisible(true)。 private GetServerInfo gif。 private InputStream in。 public JButton jButtonReg = null。 private JPasswordField jTextFieldLoginPassword = null。 private JLabel jLabelLoginPassword = null。 private JPanel jContentPane = null。出現幾個客戶端時,服務端就會才用多線程技術,這樣客戶端與客戶端的信息才不會出現混淆,而服務器端也有一個線程進行專門管理客戶端反饋過來的信息,進而提高服務器的處理效率。 為了讓我們更好的了解和設計多人聊天室這個軟件,也更好的開發(fā)和維護這個軟件,我們根據客戶端和服務器端的功能模塊之間的邏輯關系給出了一個流程圖,這個流程圖主要是分為服務器端和客戶端兩個部分,服務器端我們從建立ServerSoket端口號開始進行解析,到線程死亡結束,客戶端我們從登陸界面開始到用戶關閉聊天窗口結束。從而通過socket獲取從客戶端讀取的數據進行分析處理,最后將處理解析結果反饋給客戶端,比如,用戶登錄時,通過soket將用戶名和用戶密碼傳遞給服務器端,服務器端再將客戶端傳遞過來的數據和存儲在文件中的數據進行對比,如果數據相符合則服務器返回結果,從而跳轉到用戶信息列表界面,如果驗證失敗,則彈出相應提示,重新登陸。傳輸文件的話我們主要是運用到I/O流這個技術的,通過字符流和字符緩沖流我們將文件逐行讀取解析復制,然后通過字節(jié)流和字節(jié)輸出流將所讀取到的字符解析成字節(jié),輸入到同一名稱的文件中給用戶。 聊天窗口也是作為這個多人聊天室軟件的主界面,在這個,用戶可以進行多人聊天和私聊。反之則會彈出提示用戶昵稱或者用戶密碼輸入錯誤,提示用戶重新輸入用戶信息。在用戶輸入完用戶信息之后,雙擊登陸按鈕,客戶端Client將會開始和Server服務器進行連接,在Server和Client鏈接過程中,首先會檢查Server服務器是否啟動,亦或者是服務器網絡是否暢通,客戶端Client和Server服務器端連接是否成功,如果客戶端Client和Server沒有連接成功,登錄界面會給出一個友好的提示框,提示用戶服務器沒有啟動或者服務器Server連接錯誤。本系統主要分為兩大部分:TCP/IP Server和客戶端client以下就是客戶端Client和Server服務器端的程序運行模塊圖:客戶端的主要功能還是提供用戶之間的聊天服務和文件傳輸服務,但是我們會通過注冊頁面和登錄頁面先進行用戶驗證,然后在用戶列表界面我們找到好友進行通訊,我們可以選擇私聊和群聊,也可以向另一個用戶傳輸文件和資料,下面進行詳細分析。這也就體現了java語言的通用性和便捷性,使我們不需要為了在不同的平臺運行而去修改程序煩惱,這大大提高了我們程序和代碼的重用性,也同時提高了我們編程的效率,不過,每次的編譯執(zhí)行需要消耗一定的時間,這同時也在一定程度上降低了 Java 程序的運行效率。在Servlet方面,我們首先通過Socket建立服務器和客戶端之間的連接,創(chuàng)建Sok
點擊復制文檔內容
電大資料相關推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1