当前位置:网站首页>111.简易聊天室14:聊天室客户端
111.简易聊天室14:聊天室客户端
2022-06-29 22:34:00 【Jasonakeke】
题目描述
题目实现:实现聊天室客户端。运行程序,用户登录服务器后,可以从用户列表中选择单个用户进行聊天,也可以选择多个用户进行聊天。
解题思路
创建一个服务类:ChatClientFrame,继承JFrame类。用于进行用户登录、发送聊天信息和显示聊天信息,在该类中完成窗体界面的设计。
定义createClientSocket)方法,用于创建套接字对象、输出流对象以及启动线程对象对服务器转发的信息进行处理。
定义内部线程类ClientThread,用于对服务器端转发的信息进行处理,并显示在相应的控件中。
定义发送聊天信息的send()方法。
技术重点:
通过线程对接收到的信息进行处理,其中分为3种情况,第一种接收到的是登录用户,第二种接收到的是退出提示,第三种接收到的是消息。
代码详解
package question;
边栏推荐
- 交友平台小程序制作开发代码分享
- 5-1系統漏洞掃描
- Vs2013 how to make the program run on other computers
- Detailed description of gaussdb (DWS) complex and diverse resource load management methods
- leetcode 416. Partition equal subset sum partition equal subset sum (medium)
- SYSTEMd debugging
- 短视频平台搭建,淡入淡出 支持左滑右滑轮播图
- 把数组排成最小的数_数组中的逆序对(归并统计法)_数字在升序数组中出现的次数_丑数(剑指offer)
- Error: c2665: "qmessagebox:: critical": none of the four overloads can convert all parameter types
- The details of industry are all made by money and time
猜你喜欢

Kubernetes architecture that novices must know

Digital tracking analysis of insurance services in the first quarter of 2022

AI scene Storage Optimization: yunzhisheng supercomputing platform storage practice based on juicefs

Cloud native enthusiast weekly: cool collection of grafana monitoring panels

《天天数学》连载54:二月二十三日

解题元宇宙,网络游戏中的多元通信方案

交友平台小程序制作开发代码分享

触摸按键与按键控制对应的LED状态翻转

Ansible automatic operation and maintenance
Evolution from stand-alone to distributed database storage system
随机推荐
深入解析kubernetes中的选举机制
qt5.14.2连接ubuntu20.04的mysql数据库出错
Qt中使用QDomDocument和QDomnode来读取xml
服务器快速搭建AList集成网盘网站【宝塔面板一键部署AList】
Gnawing down the big bone - sorting (I)
直播平台开发,进入可视区域执行动画、动效、添加样式类名
Conceptual understanding of deep learning (notes)
Online text digit recognition list summation tool
IFLYTEK AI learning machine summer new product launch AI + education depth combination to create a new height of products
VS2013如何让编写的程序在其它电脑上面也能运行
R & D test time ratio, bug data analysis
Still stay up late every day and work overtime to make statements? In fact, you don't know how to make reports efficiently
Discussion on distributed unique ID generation scheme
AI scene Storage Optimization: yunzhisheng supercomputing platform storage practice based on juicefs
5-1 system vulnerability scanning
Touch key and key control corresponding LED status reversal
What if MySQL fails to store emoticons
Ce CDC Flink peut - il être utilisé pour la synchronisation incrémentale d'Oracle à MySQL?
wirehark数据分析与取证infiltration.pacapng
Mysql database: storage engine