java网络聊天室课程设计报告(内附有代码)(编辑修改稿)内容摘要:
)。 (txtIP)。 (lblPort)。 (txtPort)。 (5, 5, 100, 400)。 (110, 5, 100, 30)。 (110, 35, 400, 370)。 (200, 410, 120, 30)。 (320, 410, 120, 30)。 (pnlServerInfo)。 (lblLog)。 (taLog)。 (btnStop)。 (btnSaveLog)。 // ===========在线用户面板 ==================== pnlUser = new JPanel()。 (null)。 lblMessage = new JLabel([用户消息 ])。 taMessage = new TextArea(20, 20)。 lblNotice = new JLabel(通知: )。 txtNotice = new JTextField(20)。 btnSend = new JButton(发送 (S))。 (true)。 (new ActionListener() { public void actionPerformed(ActionEvent arg0) { serverMessage()。 } })。 lblUserCount = new JLabel(在线总人数 0 人 )。 btnKick = new JButton(踢人 (K))。 (new ActionListener() { public void actionPerformed(ActionEvent arg0) { tiRen()。 } })。 lblUser = new JLabel([在线用户列表 ])。 lstUser = new JList()。 (17)。 (180)。 //指定的 固定单元格宽度值,而不是从列表元素计算而来的宽度值 (18)。 spUser = new JScrollPane()。 (R_ALWAYS)。 ().setView(lstUser)。 (5, 5, 100, 25)。 (5, 35, 300, 360)。 (310, 5, 100, 25)。 (310, 35, 220, 360)。 (5, 410, 40, 25)。 (50, 410, 160, 25)。 (210, 410, 80, 25)。 (320, 410, 100, 25)。 (440, 410, 80, 25)。 (lblMessage)。 (taMessage)。 (lblUser)。 (spUser)。 list = new JList()。 (new String[] { })。 (list)。 (lblNotice)。 (txtNotice)。 (btnSend)。 (lblUserCount)。 (btnKick)。 // ============主标签面板 ======================== tpServer = new JTabbedPane()。 (服务器管理 , pnlServer)。 (用户信息管理 , pnlUser)。 ().add(tpServer)。 setVisible(true)。 } protected void serverMessage() { // TODO 自动生成方法存根 = ()。 ()。 } protected void closeServer() { // TODO 自动生成方法存根 ()。 // } protected void saveLog() { // TODO 自动生成方法存根 try { FileOutputStream fileoutput = new FileOutputStream(, true)。 String temp = ()。 (())。 ()。 (null, 记录保存在 )。 } catch (Exception e) { (e)。 } } protected void tiRen() { // TODO 自动生成方法存根 ti = ().toString()。 log(Ti:+ti)。 } private void log(String string) { // TODO 自动生成方法存根 String newta = ()。 newta += (\n+string)。 (newta)。 } public void actionPerformed(ActionEvent evt) { } public static void main(String args[]) { new ServerFrame()。 } } public class Connection extends Thread { /** * 与客户端通讯 Socket */ private Socket Client。 /** * 在线用户列表 */ private VectorCustomer userOnline。 /** * 聊天信息 */ private VectorChat userChat。 /** * 从客 户到服务器 输入流 */ private ObjectInputStream fromClient。 /** * 传到客户端 打印流 */ private PrintStream toClient。 /** * 注册用户列表 */ private static Vector vList = new Vector()。 /** * 临时对象 */ private Object obj。 /** * 服务器日志窗体 */ private ServerFrame sFrame。 @SuppressWarnings(unchecked) /** * 创建与客户端通讯 */ public Connection(ServerFrame frame, Socket client, Vector u, Vector c) { Client = client。 userOnline = u。 userChat = c。 sFrame = frame。 try { // 发生双向通信 // 检索客户输入 fromClient = new ObjectInputStream(())。 // 服务器写到客户 toClient = new PrintStream(())。 } catch (IOException e) { try { ()。 } catch (IOException e1) { (不能建 立流 + e1)。 return。 } } ()。 } /** * 处理与客户端的通讯线程 */ public void run() { try {// obj是 Object类的对象 obj = (Object) ()。 if (().getName().equals(Customer)) { // serverLogin()。 serverLoginDB()。 } if (().getName().equals(Register_Customer)) { // serverRegiste()。 serverRegisteDB()。 } if (().getName().equals(Message)) { serverMessage()。 } if (().getName().equals(Chat)) { serverChat()。 } if (().getName().equals(Exit)) { serverExit()。 } } catch (IOException e) { (e)。 } catch (ClassNotFoundException e1) { (读对象发生错误。 + e1)。 } finally { try { ()。 } catch (IOException e) { (e)。 } } } /** * * 登录处理 */ @SuppressWarnings(deprecation) public void serve。java网络聊天室课程设计报告(内附有代码)(编辑修改稿)
相关推荐
图 采用 DIP40 封装的 AT89S52 单片机实物图 沈阳航空航天大学北方科技学院毕业设计(论文) 7 图 采用 DIP40 封装的 AT89S52 单片机引脚定义 单片机的复位电路 单片机的复位电路如图 所示。 图 单片机复位电路。 沈阳航空航天大学北方科技学院毕业设计(论文) 8 单片机的时钟振荡电路 单片机的时钟振荡电路如图 所示。 图 单片机的时钟振荡电路。 LED 显示单元电路
信息化经济, 其 经济活动中有一半以上与信息活动有关 [1]。 在七大工业国中 ( 即美国,日本,德国,法国,英国,加拿大和意大利 ) ,与 IT相关的资本投入对 GDP 增长的贡献从 1989 年到 20xx 年间 飞速 增长 ,信息技术相关的资本投入对非信息技术资本投入的迅速替代 [2]。 我国处于工业化中期的后半段 [3],从 产业结构 上 看,我国正在从传统的劳动密集型 ,
Y6 L L L H H H Y7 L L H L L L Y8 L L H L L H Y9 L L H L H L Y10 L L H L H H Y11 L L H H L L Y12 L L H H L H Y13 L L H H H L Y14 L L H H H H Y15 X H X X X X NONE H X X X X X NONE 表 74HC154 真值表 9 2.
需求要点说明: 【 搜索 】:搜索符合条件的面试人员; 【 录用 】:选中一条面试人员信息,点击录用按纽,修改录用状态为已录用,并将该人员的个人信息导入到员工管理中,并且该模块中不再显示该人员信息; 兰州工业学院毕业设计说明书(论文) 第 12 页共 42 页 【存档】: 未达到本次公司录用的标准,但可以做为公司人才库以备后用,选择中一条面试人员信息,点击存档,将录用状态修改为“存档”
.............44 脂肪酸组分分析 .................................................................................46 基于 16S rRNA 基因序列的系统发育分析 ......................................47 基因组 DNADNA 杂交率 ...........
作只需进行一次。 在一个类中,每个对象都是类的实例 (instance),对象可以通过一个实例化机制动态地产生。 继承 (inheritance)是使用已存在的定义作为基础建立定义的技术。 新类可以通过修改或扩充已存在的类来定义,因而新类共享已有类的行为,但具有修改和添加的行为 ,这种行为共享是继承的本质特性。 这样定义的新类成为已有类的子类,已存在的那个类成为新类的父类。 由上可知