java课程设计---局域网的聊天和文件传输(编辑修改稿)内容摘要:

(button_4)。 button_5 = createButton(/)。 (button_5)。 button_6 = createButton(/)。 (button_6)。 (false)。 (new MouseAdapter() { public void mouseClicked(MouseEvent evt) { JList1 = (JList)()。 if (() == 1) { } if (() == 2) { note(正在和 +()+连接。 )。 if(()) { try{ str =().toString()。 IAddress address = ((String)(()))。 ISocketAddress socketAddress = new ISocketAddress(address, 7777)。 (socketAddress)。 clientin= ()。 clientout = ()。 (true)。 flag=true。 note(连接 +()+成功。 )。 new chatrecieve().start()。 ()。 12 setTitle(正在和 +()+聊天 )。 }catch (IOException ee) { (null,对方不在线 ,请稍后再试。 )。 note(连接 +()+失败 )。 } } try { if((().toString()))。 else { str = ().toString()。 if(flag){ try{ (over.getBytes())。 ()。 } catch(Exception eventb){ } }else { try{ (over.getBytes())。 ()。 } catch(Exception eventa){ } } ()。 (true)。 if (()) { } else { IAddress address = ((String)(()))。 ISocketAddress socketAddress = new ISocketAddress(address, 7777)。 (socketAddress)。 clientin= ()。 13 clientout = ()。 (true)。 flag=true。 note(连接 +()+成功。 )。 new chatrecieve().start()。 ()。 setTitle(正在和 +()+聊天 )。 } } } catch (IOException ee) { (null,对方不在线,请稍后再试。 )。 note(连接 +()+失败 )。 setTitle()。 }}}})。 (new TitledBorder(null, , , , null, null))。 // 设置面版的边框 (bottomscroll,)。 JButton sendButton = createButton(/)。 JButton submitButton = createButton(/)。 (new ActionListener(){ public void actionPerformed(ActionEvent e){ String s = ()。 if (!().trim().isEmpty()) { try { note(自己: +s)。 if(flag) { (())。 ()。 ()。 } (())。 ()。 14 ()。 } catch (IOException ev) { ()。 }}}})。 (new FlowLayout(,1,1))。 (sendButton)。 (submitButton)。 (sendpanel,)。 (new ActionListener(){ public void actionPerformed(ActionEvent ep){ (0)。 }})。 JPanel listpanel = new JPanel()。 (new BorderLayout())。 (listpanel)。 (new TitledBorder(null, , , , null, null))。 JPanel righttop = new JPanel()。 (new Color(252,255,255))。 (new BorderLayout())。 (new Dimension(0, 250))。 (righttop,)。 JTextField Txt = new JTextField(文件名 文件大小 )。 (false)。 (new Color(252,255,255))。 (Txt,)。 (rightscroll,)。 JLabel listLabel = new JLabel(成员列表 :)。 (listLabel,)。 JPanel rightbuttom = new JPanel()。 (new BorderLayout())。 (rightbuttom,)。 (rightscroll_2,)。 JButton filebutton = new JButton(文件发送按钮 )。 15 (filebutton,)。 (new ActionListener(){ public void actionPerformed(ActionEvent event){ if(() == 1){ (null,请选择一名用户。 )。 } else if(() == 0){ (null,请选择要传送的文件。 )。 } else{ new fileSender().start()。 }}})。 addWindowListener(new WindowAdapter(){ public void windowClosing(WindowEvent event1){ if(flag){ try{ (over.getBytes())。 ()。 } catch(Exception eventb){ } } try{ (over.getBytes())。 ()。 } catch(Exception eventa){ } }})。 clientLoader()。 new chatServer().start()。 new FileServer().start()。 setDefaultCloseOperation()。 setVisible(true)。 } 16 private JPanel sendpanel = new JPanel() { @Override protected void paintComponent(Graphics g) { (g)。 Gr。
阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。 用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。