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

正文內(nèi)容

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

2025-01-21 15:53本頁(yè)面
  

【正文】 } catch (Excep。 } finally{ //從共享中刪除當(dāng)前用戶 (())。 break。 //請(qǐng)求開始傳送文件 case : (message:開始向私人傳送文件)。 sendFileToOne1()。 break。 //請(qǐng)求個(gè)人傳送文件 case : (message:請(qǐng)求傳送文件至私人)。 break。 //文本私聊 case : (message:私聊消息)。 sendMessageToAll()。 break。 //注冊(cè)操作 case : (message:注冊(cè)操作)。 doLogin()。 int mand = 1。 } //線程體 public void run() { try { //獲取當(dāng)前連接客戶端的輸入流,用于獲取來自客戶端的信息 in = ()。 //當(dāng)前客戶端對(duì)應(yīng)的用戶信息 private UserInfo userinfo。 //當(dāng)前客戶端的輸入流 private InputStream in。 ()。 } } catch (IOException e) { ()。 while(true){ DoServiceForClient dsfc = new DoServiceForClient(())。 ServerSocket ss = new ServerSocket(7788)。 public Server(){ users = new HashMapString,UserInfo()。 (請(qǐng)求發(fā)送完畢)。 (target, out)。 if (f != null) { readyforsendfile = f。 File f = ()。 } } // 傳送文件請(qǐng)求 public void sendFile() { JFileChooser fd = new JFileChooser()。\n)。 } } }.start()。 (true)。\n)。 } ()。 int len = 1。 FileInputStream fis = new FileInputStream( readyforsendfile)。 (target, out)。 (false)。\n)。 } catch (Exception e) { ()。\n)。 } } ()。 loaded = (int)(sum+1024len?1024:lensum)。 (buf,0,loaded)。 ().setValue( ().getMaximum())。 (() + 正在接收文件。 //總共讀取的字節(jié)量 long sum=0。 byte[] buf = new byte[1024]。 long len = (in)。 } } } return textField。 } if (t instanceof Container) { textField = getTextField((Container) t)。 i++) { Component t = (i)。 for (int i = 0。 (NO, out)。 } else { // 不同意接收 (, out)。 (from, out)。 readyforgetFile = ()。 (fileName)。 if (v == ) { // 同意接收 JFileChooser fd = new JFileChooser()。 ().setValue( ().getMaximum())。 ().setValue( ().getMaximum())。 } return false。 ()。 (() + 我說:\n + () + \n)。 (target, out)。 return false。 } } // 如果當(dāng)前聊天對(duì)象不在線,則告知用戶,此好友已下線 if (!friendOnline) { (() + + 已下線..信息發(fā)送失敗\n)。 i++) { if (().get(i).equals(target)) { friendOnline = true。// 當(dāng)前聊天對(duì)象是否在線 for (int i = 0。 return true。 ().setValue( ().getMaximum())。 ((), out)。 return false。 } public boolean sendMessageToServer() { // 如果已經(jīng)沒有好友在線,則告知用戶,此好友已下線 if (().size() == 0) { (已無用戶在線...\n)。 } })。 (發(fā)送文件)。 } /** * This method initializes jButton * * return */ private JButton getJButton() { if (jButton == null) { jButton = new JButton()。 } } })。 (new Rectangle(5, 203, 333, 35))。 } return jPanel。 (true)。 (getJTextField(), null)。 (null)。 } return jContentPane。 (null)。 break。 i ().size()。 } return jFrame。 removeTalkWindowInfo()。 (getJContentPane())。 (new Dimension(361, 349))。 } } /** * This method initializes jFrame * * return */ private JFrame getJFrame() { if (jFrame == null) { jFrame = new JFrame()。 } try { out = ().getOutputStream()。 if ((ALL)) { (群聊中...)。 = target。 } public TalkWindow(String me, String target, LinkInfo linkInfo) { ().setVisible(true)。 (false)。 } /** * This method initializes jTextArea * * return */ private JTextArea getJTextArea() { if (jTextArea == null) { jTextArea = new JTextArea()。 } } ()。 i++) { if (().get(i).getTalkingWindow() .equals(this)) { ().remove(i)。 } // 關(guān)閉窗口的同時(shí)刪除聊天窗口信息 public void closeFrameAndClearTalkWindowInfo() { for (int i = 0。 (getJTextArea())。 /** * This method initializes jScrollPane * * return */ private JScrollPane getJScrollPane() { if (jScrollPane == null) { jScrollPane = new JScrollPane()。// 連接服務(wù)器端的輸出流 // 準(zhǔn)備傳送的文件 private File readyforsendfile。 private String target。 private LinkInfo linkInfo。 private JScrollPane jScrollPane = null。 private JTextField jTextField = null。 // jve:declindex=0:visualconstraint=168,56 private JPanel jContentPane = null。 }} 聊天窗口和文件傳輸界面 服務(wù)器端和客戶端通過I/O流,在建立用戶建立會(huì)話之前,會(huì)先建立一個(gè)socket連接,用來接收請(qǐng)求和發(fā)送請(qǐng)求消息,用戶之間的數(shù)據(jù)傳輸是通過Socket連接服務(wù)器端然后轉(zhuǎn)給另一個(gè)服務(wù)器端的,其中我們通過流來翻譯字節(jié)和復(fù)制字符然后傳輸給用戶,和傳輸文件的原理是差不多的。 (friend)。 TalkingMainTreeInfo treeNodeInfo = new TalkingMainTreeInfo((i),friend)。i++){ //不將自己放在好友列表上 if((i).equals(me)){ continue。 for(int i =0。amp。 } //初始化好友樹的方法 public DefaultMutableTreeNode initTree(){ DefaultMutableTreeNode root = new DefaultMutableTreeNode (好友列表(+me+))。i++){ if(((i).getDmtn())){ return (i).getUserInfo()。()0){ for(int i =0。 } public String getUserInfoByTreeNode(DefaultMutableTreeNode node){ if(allTreeNodes!=nullamp。i++){ if(().get(i).getTargetUserInfo().equals(id)){ return true。 } for(int i =0。 ().add(new TalkWindowInfo(tw,userInfo))。 } String userInfo = (node)。 ().add(new TalkWindowInfo(tw,ALL))。 //} return jTree。 if(!().equals(好友列表(+me+))){ openTalkingWindow(selectedNode)。 } /** * This method initializes jTree * * return */ private JTree getJTree(DefaultMutableTreeNode nodes) { //if (jTree == null) { jTree = new JTree(nodes)。 (new Rectangle(2, 2, 200, 376))。 } return jButtonFind。 (new ActionListener() { Override public void actionPerformed(ActionEvent e) { openTalkingWindow(null)。 (new Rectangle(1, 384, 199, 29))。 } return jContentPane。 (getJButtonFind(), null)。 } /** * This method initializes jContentPane * * return */ private JPanel getJContentPane() { if (jContentPane == null) { jContentPane = new JPanel()。 } })。 (getJContent
點(diǎn)擊復(fù)制文檔內(nèi)容
電大資料相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1