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

正文內(nèi)容

基于udp協(xié)議的聊天程序設(shè)計報告-閱讀頁

2025-02-24 03:17本頁面
  

【正文】 JTextField name。 private JButton ok,cancle。 public client() { super(登錄框 )。 (100,100)。 ip = new JTextField()。 cancle = new JButton(取消 )。 (new listenEvent())。 (EXIT_ON_CLOSE)。 (null)。 (120,10,100,30)。 (310,10,70,30)。 (ip)。 (cancle)。 (false)。 String i = ().trim()。 } else{login(n,i)。 ()。 23 DataOutputStream out = new DataOutputStream(())。 ()。 new ClientFrame(name,socket)。 } catch (UnknownHostException e) { (null,找不到主機地址 (IP錯誤 /網(wǎng)絡(luò)故障 )! ,錯誤 ,)。 } public static void main(String[] args) { new client()。 import .*。 Socket socket。 import 。 import 。 import 。 import 。 import 。 import 。 import 。 import 。 import 。 private JTextField wele,copyright,chatmsg。 private JScrollPane js。 public DataOutputStream out。 public Socket s = null。 /* 保存用戶昵稱 */ /** 25 * 初始化客戶端資源 * LoginFrame傳遞過來的參數(shù) * * EG:輸入 /輸出流(DataInputStream/DataOutputStream) * */ public ClientFrame(String name,Socket socket) { (310,660)。 (聊天室客戶端 +name+)。/* 接收從 LoginFrame中傳遞過來的 Socket */ = name+ 說: 。 ()。 copyright = new JTextField( all copyright TOPking )。 allmsg = new JTextArea()。 ( 系統(tǒng)消息 : 歡 迎登錄在線聊天室 \n)。//為 JTextArea添加滾動條 chatmsg = new JTextField(在此輸入聊天信息 )。 send = new JButton(發(fā)送 )。/* 添加事件監(jiān)聽器 */ try { 26 out = new DataOutputStream(())。 } catch (IOException e) {(null, 系統(tǒng)異常 ,錯誤 ,)。 /* 當用戶關(guān)閉窗口時進行相關(guān)的處理 eg:Socket Data(Input/Output)Stream 的關(guān)閉 */ (new WindowAdapter(){ public void windowClosing(WindowEvent we) { sendmsg(quitamp。/* 向服務(wù)器 端發(fā)送關(guān)閉信息 */ isConnected = false。/* 銷毀窗口資源 */ } })。/* 啟動讀取信息線程 */ } public void addpotocontainer() { Container c = ()。 (75,10,150,20)。 (10,560,180,30)。 (10,600,280,20)。 (js)。 (send)。 27 (true)。 } class listen implements ActionListener { public void actionPerformed(ActionEvent e) { // TODO Autogenerated method stub if(()==send||()==chatmsg) { String msg = ().trim()。 } else {sendmsg((new Date()).toLocaleString()+\n+nic+msg+\n)。} } } } /* 向服務(wù)器端發(fā)送信息 */ public void sendmsg(String m) { if(isConnected)//如果 socket的輸出流沒關(guān)閉 { try { (m)。 } } else { 28 (null,發(fā)送信息失敗 !(服務(wù)器關(guān)閉 /網(wǎng)絡(luò)故障 ),錯誤 ,)。 } public void read() { while(isConnected) { try { String msg = ()。 isConnected = false。 } catch (IOException e) { } }//end while (null,讀取消息失敗 (服務(wù)器關(guān)閉 /網(wǎng)絡(luò)故障 )! ,錯誤 ,)。 29 ()。 } catch (IOException e) { }
點擊復(fù)制文檔內(nèi)容
環(huán)評公示相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1