当前位置:网站首页>111.简易聊天室14:聊天室客户端
111.简易聊天室14:聊天室客户端
2022-06-29 22:34:00 【Jasonakeke】
题目描述
题目实现:实现聊天室客户端。运行程序,用户登录服务器后,可以从用户列表中选择单个用户进行聊天,也可以选择多个用户进行聊天。
解题思路
创建一个服务类:ChatClientFrame,继承JFrame类。用于进行用户登录、发送聊天信息和显示聊天信息,在该类中完成窗体界面的设计。
定义createClientSocket)方法,用于创建套接字对象、输出流对象以及启动线程对象对服务器转发的信息进行处理。
定义内部线程类ClientThread,用于对服务器端转发的信息进行处理,并显示在相应的控件中。
定义发送聊天信息的send()方法。
技术重点:
通过线程对接收到的信息进行处理,其中分为3种情况,第一种接收到的是登录用户,第二种接收到的是退出提示,第三种接收到的是消息。
代码详解
package question;
边栏推荐
- 论文浅尝 | KR-GCN: 知识感知推理的可解释推荐系统
- MySQL lock common knowledge points & summary of interview questions
- 读书郎上市背后隐忧:业绩下滑明显,市场地位较靠后,竞争力存疑
- 2022年第一季度保险服务数字化跟踪分析
- 【无工具搭建PHP8+oracle11g+Windows环境】内网/无网络/Win10/PHP连接oracle数据库实例
- leetcode 416. Partition equal subset sum partition equal subset sum (medium)
- laravel 关联模型 多态关系
- Hezhou air32f103cbt6 development board hands-on Report
- Ansible automatic operation and maintenance
- 把数组排成最小的数_数组中的逆序对(归并统计法)_数字在升序数组中出现的次数_丑数(剑指offer)
猜你喜欢

80-Redis详解

Hematemesis finishing: a rare map of architects!

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

IFLYTEK AI learning machine summer new product launch AI + education depth combination to create a new height of products

服务器快速搭建AList集成网盘网站【宝塔面板一键部署AList】

error: C2665: “QMessageBox::critical”: 4 个重载中没有一个可以转换所有参数类型

Basic use of Nacos configuration center

论文浅尝 | KR-GCN: 知识感知推理的可解释推荐系统
Why does copying files on a shared folder on a local area network (ERP server) result in the loss of the local Internet

Gnawing down the big bone - sorting (I)
随机推荐
Optional类的高级使用
《天天数学》连载54:二月二十三日
还天天熬夜加班做报表?其实你根本不懂如何高效做报表
Efficient implementation of dynamiccast with template function and specialization function
Taishan Office Technology Lecture: all elements in a row have the same height
Just like our previous views on the Internet, our understanding of the Internet began to become deeper
qt5.14.2连接ubuntu20.04的mysql数据库出错
How ZABBIX 5.0 adds esxi6.7 to monitoring
GWD: rotating target detection based on Gaussian Wasserstein distance | ICML 2021
[从零开始学习FPGA编程-51]:高阶篇 - 基于IP核的FPGA开发- 什么是FPGA IP核(软核、固核、硬核)与学习方法
Still stay up late every day and work overtime to make statements? In fact, you don't know how to make reports efficiently
Realizing deep learning framework from zero -- RNN from theory to practice [practice]
Build a short video platform, fade in and fade out, and support left sliding and right pulley to broadcast pictures
Gnawing down the big bone - sorting (I)
Portable 4K audio and video conference terminal all-in-one machine with 8x digital zoom
Does rapid software delivery really need to be at the cost of security?
這個flink cdc可以用在做oracle到mysql的,增量同步嗎
Can the flick CDC be used for incremental synchronization from Oracle to MySQL
Does rapid software delivery really need to be at the cost of security?
[proteus simulation] digital tube display of stepping motor speed